Top "Tsql" questions

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

Extracting hours from a DateTime (SQL Server 2005)

I can extract the month and day by using Day(Date()), Month(Date()). I can't extract hours, with HOUR(Date()). …

sql tsql datetime sql-server-2005 hour
What is a stored procedure?

What is a "stored procedure" and how do they work? What is the make-up of a stored procedure (things each …

sql sql-server tsql stored-procedures
How do you return the column names of a table?

How would I return the column names of a table using SQL Server 2008? i.e. a table contains these columns- …

sql sql-server tsql
How to update two tables in one statement in SQL Server 2005?

I want to update two tables in one go. How do I do that in SQL Server 2005? UPDATE Table1, Table2 …

sql sql-server sql-server-2005 tsql
Is there a combination of "LIKE" and "IN" in SQL?

In SQL I (sadly) often have to use "LIKE" conditions due to databases that violate nearly every rule of normalization. …

sql sql-server oracle tsql plsql
Check if a row exists, otherwise insert

I need to write a T-SQL stored procedure that updates a row in a table. If the row doesn't exist, …

sql sql-server sql-server-2008 tsql
DateTime2 vs DateTime in SQL Server

Which one: datetime datetime2 is the recommended way to store date and time in SQL Server 2008+? I'm aware of differences …

sql sql-server tsql datetime datetime2
How do I format a number with commas in T-SQL?

I'm running some administrative queries and compiling results from sp_spaceused in SQL Server 2008 to look at data/index space …

sql-server tsql
Is it possible to specify condition in Count()?

Is it possible to specify a condition in Count()? I would like to count only the rows that have, for …

sql sql-server tsql
How to update Identity Column in SQL Server?

I have SQL Server database and I want to change the identity column because it started with a big number 10010 …

sql sql-server tsql sql-server-2008