A Jr. DBA asked me three times in one day how to create a clustered primary key, so I gave him this ALTER TABLE example. He never asked again.
SQL SERVER – 2005 – Sample Example of RANKING Functions – ROW_NUMBER, RANK, DENSE_RANK, NTILE
SQL Server 2005 has four ranking functions: ROW_NUMBER, RANK, DENSE_RANK and NTILE. I explain what each returns and show a sample example of all four.
SQL SERVER – Executing Remote Stored Procedure – Calling Stored Procedure on Linked Server
Two ways to call a remote stored procedure on a linked server: a four part name with EXEC, or the OPENQUERY distributed query function.
SQL SERVER – 2005 – Open SSMS From Command Prompt – sqlwb.exe Example
Open SSMS from command prompt with the sqlwb command. I show its syntax and the switches I use, like -E and -nosplash, to start Management Studio.
SQL SERVER – Find Name of The SQL Server Instance
SELECT @@SERVERNAME returns the name of the SQL Server instance. We used it in stored procedures that ran different logic on each server during a migration.
SQL SERVER – 2005 – OUTPUT Clause Example and Explanation with INSERT, UPDATE, DELETE
The SQL Server 2005 OUTPUT clause returns the rows changed by INSERT, UPDATE or DELETE. Each OUTPUT clause example below shows how.







