Top "Tsql" questions

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

Alter column, add default constraint

I have a table and one of the columns is "Date" of type datetime. We decided to add a default …

sql-server sql-server-2008 tsql alter-table alter-column
How To Create Table with Identity Column

I have an existing table that I am about to blow away because I did not create it with the …

sql sql-server tsql
Changing the maximum length of a varchar column?

I'm trying to update the length of a varchar column from 255 characters to 500 without losing the contents. I've dropped and …

sql sql-server sql-server-2008 tsql varchar
Convert multiple rows into one with comma as separator

If I issue SELECT username FROM Users I get this result: username -------- Paul John Mary but what I really …

tsql rows csv
Avoid duplicates in INSERT INTO SELECT query in SQL Server

I have the following two tables: Table1 ---------- ID Name 1 A 2 B 3 C Table2 ---------- ID Name 1 Z I need …

sql sql-server tsql sql-insert
SQL Server 2008: How to query all databases sizes?

I have MS SQL 2008 R2, 500 databases. What is the most efficient, easiest and 'modern' way to query all databases sizes. …

sql sql-server tsql sql-server-2008-r2
How can I use optional parameters in a T-SQL stored procedure?

I am creating a stored procedure to do a search through a table. I have many different search fields, all …

tsql optional-parameters
Creating an index on a table variable

Can you create an index on a table variable in SQL Server 2000? i.e. DECLARE @TEMPTABLE TABLE ( [ID] [int] NOT …

sql sql-server tsql indexing table-variable
Differences between MySQL and SQL Server

I'm an ASP.NET developer who has used Microsoft SQL Server for all my database needs (both at work and …

mysql sql-server tsql
How do I drop a foreign key in SQL Server?

I have created a foreign key (in SQL Server) by: alter table company add CountryID varchar(3); alter table company add …

sql-server tsql