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 - Difference Between Candidate Keys and Primary Key

SQL SERVER – Difference Between Candidate Keys and Primary Key

May 30, 2009
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Function, SQL Scripts

What is the difference between a candidate key and a primary key? A table can have many candidate keys, but only one of them becomes the primary key.

Read More
SQL SERVER - Find Hostname and Current Logged In User Name

SQL SERVER – Find Hostname and Current Logged In User Name

May 26, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL Server Security

Connected to many servers in SSMS? HOST_NAME() and SUSER_NAME() show the hostname and current logged in user for any query window.

Read More
SQL SERVER - Leading Zero to Number

SQL SERVER – Leading Zero to Number

April 24, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Readers keep asking how to add a leading zero to a number. Here are my two earlier articles that pad a number with zeros for a fixed width display.

Read More
SQL Server Management Studio Execution Plan.

SQL SERVER – Find All Servers From Local Network – Using sqlcmd – Detect Installed SQL Server on Network

March 18, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Utility, sqlcmd

Find every SQL Server on network with one command: sqlcmd -L or osql -L lists the instances on your local network. An update to my old isql script.

Read More
zero

SQL SERVER – UDF – Pad Ride Side of Number with 0 – Fixed Width Number Display

March 16, 2009
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Function, SQL Scripts, SQL Server, SQL Utility

SQL SERVER – UDF – Pad Ride Side of Number with 0 – Fixed Width Number Display. Let us learn more about this blog.

Read More
SQL SERVER - Pad Ride Side of Number with 0 - Fixed Width Number Display

SQL SERVER – Pad Right Side of Number with 0 – Fixed Width Number Display

March 10, 2009
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Function, SQL Scripts, SQL Server, SQL Utility

A reader needed a fixed width number display, like 1 shown as 0000001. SQL Server has no ready-made function, but a simple string trick does it.

Read More
SQL SERVER - Generate A Single Random Number for Range of Rows of Any Table - Very interesting Question from Reader

SQL SERVER – Generate A Single Random Number for Range of Rows of Any Table – Very interesting Question from Reader

January 28, 2009
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Random, SQL Scripts

A reader asked how to get a single random number for a set of rows, like one per PostalCode. I compare NEWID() for each row with RAND() for a whole set.

Read More
Previous 1 … 35 36 37 38 39 40 41 … 55 Next
  • Books
  • Testimonials
  • Privacy Policy

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