I have tried to explain the usage of simple WHILE loop in the first example. BREAK keywords will exit the stop the while loop and control is moved.
SQL SERVER – Get Permissions of My Username / Userlogin on Server / Database
Invited to review a big company’s schema, I wanted to know my own permissions without asking their DBA. fn_my_permissions shows them at server and database level.
SQL SERVER – Difference Between @@Version and xp_msver – Retrieve SQL Server Information
SELECT @@Version gives the SQL Server version, edition and service pack in one string. I compare @@Version and xp_msver, which returns more server details.
SQL SERVER – 2005 – Limitation of Online Index Rebuld Operation
What is an online index rebuild, and which indexes can not be rebuilt online? A smart interview candidate and I found four, and Books Online lists all six.
SQL SERVER – Set Server Level FILLFACTOR Using T-SQL Script
A short T-SQL script to set server level FILLFACTOR, plus the Books Online definition of FILLFACTOR and what its values from 0 to 100 mean.
SQL SERVER – Types of DBCC Commands When Used as Database Console Commands
The four types of DBCC Database Console Commands: maintenance, miscellaneous, informational and validation, with a couple of examples of each from MSDN.
What RESTORE VERIFYONLY Checks and What It Misses
RESTORE VERIFYONLY checks backup readability and checksums, but it cannot prove a full restore or healthy data; pair it with restore tests.
SQL SERVER – Three T-SQL Script to Create Primary Keys on Table
Three T-SQL scripts to create primary keys: two while creating the table and one with ALTER TABLE later, where the column must first be NOT NULL.
STConvexHull: Enclose a Shape Without Its Indentations
STConvexHull encloses a geometry with its smallest convex hull. Compare a concave polygon, a collinear line and a point using area and membership.










