I am having an issue to passing data between two SQL Server databases. I can not simply use Import/Export functions or Data Transfer Functions from SSIS because I was asked to transfer “20%” data with more than 15 criteria among 200 related tables. Also we are not allowed to use the...
Hi, Does anyone know the TSQL to change the identity column on a table in SQL Server 2000. And also the TSQL to change trigger to not for replication. Thanks
Say I want to derive the following: Select ID, F1 from table Union Select ID, F2 from table Union Select ID, F3 from table Union … etc until F10. Is there smart and easy way so that I can just provide a list: F1,F2,F3,…,F10 and somehow be able to have the select statement loop through it? Also,...
I need examples of T-SQL queries running on SQL Server 2005 that retrieve data from a MS ACCESS 2007 Table. Any explanations are appreciated. Thanks
Hi, I want to know y does the following script run in SQL and not in T-SQL DECLARE @tblName varchar(30) SET @tblName = CONVERT(VARCHAR(20),GETDATE(),112) + 'Table' DECLARE @sql nvarchar(4000) SELECT @sql = 'CREATE TABLE "' + @tblName + '" ( ID VARCHAR(15), Name VARCHAR(15) )' EXEC(@sql) go it...
How can ensure that when certain columns in a row are INSERTed/UPDATEd, the first letter of the value is capitalized and the rest are lower case? For example "QUESTION" or "question" should be converted to "Question".
before runing DBCC CHECKDB WITH repair_allow_data_loss, How can i know what table and data that will be deleted
I'm wondering why it is difficult to find an example ( in literature or Internet ) example of converting a T-SQL procedure which contains "out" variables into identical C# CLR stored procedure. Is there something which prohibits this conversion ? If not, can someone provide or cite example...
Does anyone know where I can get a list describing, in layman's terms, all the sp_usr... stored prodedures in the Master database? New to all this and don't have the time or knowledge to decipher the TSQL behind it. Hope someone can help! Cheers
I need to figure out age from a birthday. When I use the DATEDIFF function for year, the number of years is one year ahead if the birthday hasn't passed yet for this year. How can I get the accurate age based on the day and month of the birthday.
Hi,How can I drop all connections of a database through TSQL commands.(NOT SMO)
I've been given an Oracle DB that has some triggers and "LOAD DATA" jobs. Is there a tool/utility to convert the triggers/loads from PL/SQL into T-SQL?
I need a T-SQL query to find a list of all database names and sizes from multiple SQL 2005 servers that are connected in a local network. Does one exist?
Hi, I have a csv with only one field with multiple rows, when i am using bulk insert to insert into sql server table, all the rows are inserted in to single column instead of multiple rows.I dont have a delimiter. csv file: (First row is blank) apple bat cat doll when i used the below command...
Hi, I've been told to never use cursor in SQL, because of possibility of memory leak, etc. But I have no idea of how to implement my script without them. My script doesn't execute anything on the database, it simply use cursor to create another TSQL script that does the execution. EG. open...
This is our SQL code: Select addrid,addrkey,addrline1,addrline2,addrline3,addrcity,addrplace,addrzipcod,addrtype,addrphone,jobsconame,addrmc1, CASE month(getdate()) WHEN 1 THEN addrjan WHEN 2 THEN addrfeb ...
In T-SQL code on SQL Server 2005, the variable :t_id is being passed from other pages and works in other statements, but it is not parsing within this statement: define("TF_T_INFO_INSERET", " insert into TFT (WG_ID,task_id,tf_id) SELECT (select WGID from LU_T where TID= :t_id ), :t_id , (select...
All, how can I make this query faster? Here is my code of stored procedure: ALTER procedure [dbo].[GetLMPReport] ( @typeId tinyint, @dataType varchar(2), @date date ) AS begin select distinct p.name, ISNULL (td24.price, 0) as '00', ISNULL (td1.price, 0) as '100', ISNULL (td2.price, 0) as...


