Top "Sql-server-2005" questions

Use this tag for questions specific to the 2005 version of Microsoft's SQL Server.

How do I use an INSERT statement's OUTPUT clause to get the identity value?

If I have an insert statement such as: INSERT INTO MyTable ( Name, Address, PhoneNo ) VALUES ( 'Yatrix', '1234 Address Stuff', '1112223333…

sql sql-server-2005 insert
Get the week start date and week end date from week number

I have a query that counts member's wedding dates in the database. SELECT SUM(NumberOfBrides) AS [Wedding Count] , DATEPART( wk, …

sql sql-server date sql-server-2005 week-number
What is the maximum characters for the NVARCHAR(MAX)?

I have declared a column of type NVARCHAR(MAX) in SQL Server 2008, what would be its exact maximum characters having …

sql-server sql-server-2008 sql-server-2005
Querying data by joining two tables in two database on different servers

There are two tables in two different databases on different servers, I need to join them so as to make …

sql sql-server database sql-server-2005 sql-server-2008
How to determine total number of open/active connections in ms sql server 2005

My PHP/MS Sql Server 2005/win 2003 Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i …

sql-server database sql-server-2005 connection
How do I drop a foreign key constraint only if it exists in sql server?

I can drop a table if it exists using the following code but do not know how to do the …

sql sql-server sql-server-2005 tsql
How to change column order in a table using sql query in sql server 2005?

How to change column order in a table using SQL query in SQL Server 2005? I want to rearrange column order …

sql sql-server-2005
Better techniques for trimming leading zeros in SQL Server?

I've been using this for some time: SUBSTRING(str_col, PATINDEX('%[^0]%', str_col), LEN(str_col)) However recently, …

sql sql-server sql-server-2005 tsql string
How to rollback or commit a transaction in SQL Server

In my stored procedure, I have three insert statements. On duplicate key value insertion first two queries generate the error …

sql sql-server sql-server-2008 sql-server-2005
Warning: Null value is eliminated by an aggregate or other SET operation in Aqua Data Studio

I have a problem when data is null and the warning has appear when the result is display. How to …

sql sql-server-2005