This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - T-SQL Script to Add Clustered Primary Key

SQL SERVER – T-SQL Script to Add Clustered Primary Key

October 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

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.

Read More
Sql server query results window.

SQL SERVER – 2005 – Sample Example of RANKING Functions – ROW_NUMBER, RANK, DENSE_RANK, NTILE

October 9, 2007
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Scripts

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.

Read More
SQL SERVER - Executing Remote Stored Procedure - Calling Stored Procedure on Linked Server

SQL SERVER – Executing Remote Stored Procedure – Calling Stored Procedure on Linked Server

October 6, 2007
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure

Two ways to call a remote stored procedure on a linked server: a four part name with EXEC, or the OPENQUERY distributed query function.

Read More
SQL SERVER - 2005 - Open SSMS From Command Prompt - sqlwb.exe Example

SQL SERVER – 2005 – Open SSMS From Command Prompt – sqlwb.exe Example

October 5, 2007
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server Management Studio, SQL Shortcut, SQL Utility

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.

Read More
SQL SERVER - 2005 - Explanation of TRY…CATCH and ERROR Handling With RAISEERROR Function

SQL SERVER – 2005 – Explanation of TRY…CATCH and ERROR Handling With RAISEERROR Function

October 3, 2007
Pinal Dave
SQL Performance
SQL Error Messages, SQL Scripts

Yes, TRY…CATCH can use the RAISEERROR function. A developer said I never showed it, so here are simple SQL Server 2005 examples with and without it.

Read More
SQL SERVER - Find Name of The SQL Server Instance

SQL SERVER – Find Name of The SQL Server Instance

October 2, 2007
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Utility

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.

Read More
SQL SERVER - 2005 - OUTPUT Clause Example and Explanation with INSERT, UPDATE, DELETE

SQL SERVER – 2005 – OUTPUT Clause Example and Explanation with INSERT, UPDATE, DELETE

October 1, 2007
Pinal Dave
SQL Performance
SQL Scripts

The SQL Server 2005 OUTPUT clause returns the rows changed by INSERT, UPDATE or DELETE. Each OUTPUT clause example below shows how.

Read More
Previous 1 … 302 303 304 305 306 307 308 … 336 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com