Top "Tsql" questions

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

How can I do an UPDATE statement with JOIN in SQL Server?

I need to update this table in SQL Server with data from its 'parent' table, see below: Table: sale id (…

sql sql-server tsql sql-server-2005 sql-update
LEFT JOIN vs. LEFT OUTER JOIN in SQL Server

What is the difference between LEFT JOIN and LEFT OUTER JOIN?

sql-server tsql left-join outer-join
Get size of all tables in database

I have inherited a fairly large SQL Server database. It seems to take up more space than I would expect, …

sql-server tsql
Altering a column: null to not null

I have a table that has several nullable integer columns. This is undesirable for several reasons, so I am looking …

sql-server tsql null alter-table alter-column
Check if table exists in SQL Server

I would like this to be the ultimate discussion on how to check if a table exists in SQL Server 2000/2005 …

sql-server tsql sql-server-2005 sql-server-2000
How to drop a table if it exists?

The table name is Scores. Is it correct to do the following? IF EXISTS(SELECT * FROM dbo.Scores) DROP TABLE …

sql-server tsql
How to check if a column exists in a SQL Server table?

I need to add a specific column if it does not exist. I have something like the following, but it …

sql-server sql-server-2008 tsql sql-server-2012 sql-server-2016
How can I remove duplicate rows?

What is the best way to remove duplicate rows from a fairly large SQL Server table (i.e. 300,000+ rows)? The …

sql-server tsql duplicates
How do I escape a single quote in SQL Server?

I'm trying to insert some text data into a table in SQL Server 9. The text includes a single quote('). …

sql sql-server tsql delimiter single-quotes
How to get a date in YYYY-MM-DD format from a TSQL datetime field?

How do I retrieve a date from SQL Server in YYYY-MM-DD format? I need this to work with SQL Server 2000 …

sql-server tsql