File Description
------- -------------------------------------------------------------------------------
ac ALTERCOLUMN
af ALTERFUNCTION
ap ALTERPROCEDURE
at ALTERTABLE
ata Addcolumn
atac Modifycolumn
atd Dropcolumn
atdc Dropconstraint
atdt Disable a triggerontable
atdta Disableall triggers ontable
atet Enable a triggerontable
ateta Enableall triggers ontable
be BEGIN...END
bt BEGINTRANSACTION
ccc CREATE CELL CALCULATION fragment
cci Create non-uniqueclusteredindex
cdb CREATEDATABASE
cdbsnap Create a databasesnapshot
citf Create inline table-valued function
cj CROSSJOIN fragment
cl Create a new SQL Server login
clrp Create a CLR stored procedure
cni Create non-uniquenonclusteredindex
cp Create a stored procedure
cseq Create a sequence (start,end, optional: cycle, cache)
csf Create scalar function
ct Create a table
cte Create a new common table expression
ctf Createtable-valued function
ctr Committransaction
ctt Createtemptable(drops ifexists)
cu Create a databaseuser
cuci Createuniqueclusteredindex
cuni Createuniquenonclusteredindex
curff Boilerplate code for fast-forward read-only cursor
cv Create a view
cw CASEWHEN
dd Drop a database
df DELETEFROM fragment
dfn Drop a function
di Drop an index
dl Drop a login
dp Drop a stored procedure
dseq Drop a sequence
dt Drop a table
du Drop a user
dupk Checkfor duplicated valueson a column
dv Drop a view
err Inserts @@ERRORfunctioncall
fj FULLJOIN fragment
foj FULLOUTERJOIN fragment
gb GROUPBY
gep GrantExecuteon procedures
git GrantInsertontable
giust GrantInsert,Select,Updateontable
gst GrantSelectontable
gut GrantUpdateontable
header Template header for stored procedure
hhmm string to HH:mm format
ifs IF fragment
ii INSERTINTO fragment
ij INNERJOIN fragment
j JOIN fragment
inn ISNOTNULL fragment
is Shortcut for INFORMATION_SCHEMA
isc Column Information Grabber
isns Wraps the currently selected column(text)in an ISNULL Function,with a default empty string (this is an inline selected textfunction)
isnn Wraps the currently selected column(number)in an ISNULL Function,with a defaultto zero (this is an inline selected textfunction)
lin Line
linn Double line with space fortextcomment
lj LEFTJOIN
lk LIKE'% %' fragment
loj LEFTOUTERJOIN fragment
mmddyyyy String to mmddyyyy format
mmddyyyyhhmm String to mmddyyyyhhmm format
mro Retrieves information about 20 most recently created objects fromdatabase
neo A word from one of our sponsors
num Format a big number into a readable format
numc Nicely formatted COUNT(*)as numRows
nvseq Nextvaluefor a sequence
ob ORDERBY
rj RIGHTJOIN fragment
rnum ROW_NUMBER()OVER() fragment
roj RIGHTOUTERJOIN fragment
rt Rollbacktransaction
san Change the current ANSI_NULLS setting
scf Count number of records returned by query, formatted nicely
sd SELECTDISTINCT
setvar SQL CMD setvar fragment
smf SELECTSUM()FROM
sph Execute sp_help
spt Execute sp_helptext
sqi Change the current QUOTED_IDENTIFIER setting
ss0 SELECTTOP0*FROM
ssf SELECT*FROM fragment
ssf2 SELECT*FROM fragment, formatted nicely with tabs and newline.
sst SELECTTOP1000*FROM
st100 SELECTtop100rows
sxa Change the current XACT_ABORT setting
tc TRY ... CATCH fragment
today CAST(GETDATE()asdate) fragment
trim Trim a string: LTRIM(RTRIM($CURSOR$))
trims Wrap selected textin LTRIM(RTRIM($SELECTEDTEXT$))
uci UniqueClusteredIndex
w2 Execute sp_who2
wdc WITH(DATA_COMPRESSION = PAGE) fragment
wt WITH(TABLOCK) fragment
xpfd Retrieve free space onallfixed drives
yell Vent your frustration