I have created a cheat sheet (factsheet) for SQL Server (6.5, 7.0, 2000 and 2005) developers that fits on one A4 (printed on both sides) so that you can laminate it and keep it on your desk. You have to print it with a color-printer to be able to use all information!
An overview of the contents of this factsheet:
- Some examples of connectionstrings
- The syntaxis for SELECT, UPDATE, DELETE and INSERT queries
- The syntaxis for CREATE TABLE and ALTER TABLE
- CREATING, ALTERING and DELETING Stored Procedures, Indexes, Views, Triggers and Functions
- A legend of the 'Execution Plan Icons', including some optimizing tips and tricks.
- All datatypes, including memory-usage and indication for best performing types
- All string functions
- All system functions
- All date and time functions
- A list of all dateparts
- The cursor functions
- The mathematical functions
If you have some feedback, please send it to me so that I can improve this factsheet.
Labels: Factsheet, SQL Server, SQL Server 2000, SQL Server 2005
Posted by Xander Zelders
Thanks a lot. Good job. Use it very often :o)
Under creating indexes, you should add that columns used as foreign keys should be indexed (they are sometimes not the primary key on foreign table).
You should add that columns used in foreign keys should be indexed also. This is often forgotten and can lead to some really bad query performance.
I am new to DB development... but this page seems to be a tool that will help me a lot
Many, Many Thanks!!!
L Piccini
hi.. i'm getting the page cannot be found when i'm trying to open the pdf.. thanks..
The download link is not working, plz check that
download link still not working :-<
The link should be updated to point to http://www.dotnet4all.com/snippets/factsheet%20SQL%20Server.pdf
Great sheet, just one thing that I believe is a typo - under Dateparts on the first page, for weekday you have "dd" as the abbreviation, when it is really "dw" - or see http://www.java2s.com/Code/SQLServer/Date-Timezone/DatepartsandAbbreviations.htm
Couple notes on system functions--
CURRENT_USER: Returns the database user name for the current connection.
SYSTEM_USER: Returns the server login name for the current connection.
SCOPE_IDENTITY: Returns the last-inserted identity value in the current scope. Recommended over @@IDENTITY.