T-SQL Questions and Answers

Recent IT Questions

1 - 20 of 59
<<PREVIOUS 1|2|3 NEXT>>

passing data between two SQL Server databases

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...

Answer Question   |  Nov 16 2009  6:29 PM GMT
SQL 2005, T-SQL, Stored Procedures
asked by LL123

  5 pts.

Set identity to not for replication in T-SQL

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

View Answer   |  Oct 20 2009  5:58 AM GMT
SQL Server 2000, ALTER, T-SQL
asked by Db23

  230 pts.

SQL select loop list?

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,...

Answer Question   |  Sep 4 2009  3:25 AM GMT
SELECT, SQL Select, T-SQL
asked by Vinical

  5 pts.

T-SQL query to ACESS 2007 database

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

Answer Question   |  Aug 11 2009  6:32 PM GMT
Access 2007, Access Database, SQL Server 2005
asked by DamMan

  5 pts.

Variables in T-SQL

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...

View Answer   |  Jul 14 2009  12:33 AM GMT
T-SQL, SQL
asked by Babar1982

  20 pts.

Capitalize First Character

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".

View Answer   |  Jun 16 2009  2:43 PM GMT
T-SQL, INSERT statement
asked by VelameLaCosa

  65 pts.

DBCC CHECKDB

before runing DBCC CHECKDB WITH repair_allow_data_loss, How can i know what table and data that will be deleted

View Answer   |  May 21 2009  9:27 AM GMT
DBCC CHECKDB statement, T-SQL, SQL
asked by Sreenu12

  5 pts.

question: T-SQL stored procedure conversion to C# CLR assembly....

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...

View Answer   |  May 18 2009  4:49 PM GMT
T-SQL, T-SQL Stored Procedures, C#
asked by Tann

  5 pts.

stored procs in Master db, sql server 2005

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

View Answer   |  May 12 2009  3:49 PM GMT
SQL Server stored procedures, SQL Server 2005, T-SQL
asked by GillsJules

  5 pts.

DATEDIFF - 1 year off

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.

View Answer   |  May 5 2009  4:13 PM GMT
DATEDIFF, T-SQL
asked by Bananahead

  60 pts.

Drop Database Connections

Hi,How can I drop all connections of a database through TSQL commands.(NOT SMO)

View Answer   |  Apr 11 2009  8:12 AM GMT
T-SQL, SQL Server databases, SQL Server 2005
asked by Javad

  5 pts.

How can I correct sCaller errors in T-SQL?

How can I correct generic sCaller errors in T-SQL?

Answer Question   |  Apr 10 2009  6:09 PM GMT
T-SQL, SQL Server, sCaller
asked by SQL Server Ask the Experts

  2445 pts.

Convert Oracle code to Microsoft SQL code

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?

View Answer   |  Mar 30 2009  9:20 PM GMT
T-SQL, PL/SQL, Oracle import/export
asked by VelameLaCosa

  65 pts.

Searching for a T-SQL query to find data from multiple SQL 2005 servers

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?

View Answer   |  Mar 18 2009  3:28 PM GMT
SQL Server 2005, T-SQL, SQL Server Query
asked by SQL Server Ask the Experts

  2445 pts.

What is the difference between SQL and T-SQL?

What is the difference between SQL and T-SQL?

View Answer   |  Mar 10 2009  6:30 PM GMT
SQL, T-SQL
asked by SQL Server Ask the Experts

  2445 pts.

help on Bulk insert and xp_cmdshell rename

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...

View Answer   |  Mar 5 2009  6:49 PM GMT
T-SQL, Bulk Inserts, CSV
asked by GIG

  240 pts.

SQL Cursor to use or not to use

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...

View Answer   |  Jan 7 2009  1:39 PM GMT
SQL Cursors, SQL, T-SQL
asked by Db23

  230 pts.

Referencing a calculated column in a SQL clause

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 ...

View Answer   |  Dec 18 2008  7:46 PM GMT
T-SQL, SQL Server
asked by SQL Server Ask the Experts

  2445 pts.

Error in SQL Server 2005 with passing a variable

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...

Answer Question   |  Dec 12 2008  4:23 PM GMT
T-SQL, SQL Server 2005, SQL Server errors
asked by SQL Server Ask the Experts

  2445 pts.

how can make this SQL Server query faster

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...

View Answer   |  Dec 3 2008  6:10 PM GMT
T-SQL, SQL Server 2008, SQL Query
asked by Singhal1

  20 pts.

1 - 20 of 59
<<PREVIOUS 1|2|3 NEXT>>