Top "Tsql" questions

T-SQL (Transact Structured Query Language) is the extension of SQL functionality supported by Sybase ASE and Microsoft SQL Server.

SQL Server SELECT into existing table

I am trying to select some fields from one table and insert them into an existing table from a stored …

sql sql-server tsql stored-procedures
SQL Server String or binary data would be truncated

I am involved in a data migration project. I am getting the following error when I try to insert data …

sql-server tsql sql-server-2005 migration data-migration
Simple DateTime sql query

How do I query DateTime database field within a certain range? I am using SQL SERVER 2005 Error code below SELECT * …

sql sql-server sql-server-2005 tsql sql-server-2008
Insert Update trigger how to determine if insert or update

I need to write an Insert, Update Trigger on table A which will delete all rows from table B whose …

sql-server tsql triggers
Turning a Comma Separated string into individual rows

I have a SQL Table like this: | SomeID | OtherID | Data +----------------+-------------+------------------- | abcdef-..... | cdef123-... | 18,20,22 | abcdef-..... | 4554a24-... | 17,19 | 987654-..... | 12324…

sql-server tsql split comma
How do I remove the first characters of a specific column in a table?

In SQL, how can I remove the first 4 characters of values of a specific column in a table? Column name …

sql sql-server string tsql
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS

My query is as follows, and contains a subquery within it: select count(distinct dNum) from myDB.dbo.AQ where …

sql sql-server tsql exists
T-SQL CASE Clause: How to specify WHEN NULL

I wrote a T-SQL Statement similar like this (the original one looks different but I want to give an easy …

tsql
Counting DISTINCT over multiple columns

Is there a better way of doing a query like this: SELECT COUNT(*) FROM (SELECT DISTINCT DocumentId, DocumentSessionId FROM DocumentOutputItems) …

sql sql-server performance tsql query-optimization
Function to Calculate Median in SQL Server

According to MSDN, Median is not available as an aggregate function in Transact-SQL. However, I would like to find out …

sql-server tsql aggregate-functions median