25-05-2012 Go is not a SQL or Transact SQL command. Go is a command recognized by sqlcmd and osql facilities provided by SQL server studio. Go specifies an end to a particular SQL batch. Once the parser interprets a Go, that block is considered completed and the following SQL are considered as new batch tillContinue reading “What is Go in SQL Server and the Importance of Using Go”
Category Archives: SQL Server
Importance Of Specifying Variable Length For Varchar in SQL Stored Procedures
23-05-2012 If you don’t specify a variable length for NVarchar, Varchar variables, the parser will assume the length of 1. It will not complain. Instead it will just truncate whatever you pass to the variable and use the first character. This mistake can cost you lots of time. Especially if you are working on aContinue reading “Importance Of Specifying Variable Length For Varchar in SQL Stored Procedures”
Where Vs Having In SQL
21-05-2012 The Having clause can only be used when you are using the group by phrase. When you are using the Group By phrase in a query, you can use the Having clause for pretty much everything you can do with the Where clause. But not vise versa. The where clause doesn’t support aggregate functionsContinue reading “Where Vs Having In SQL”
How To Check For NULL Values Correctly In SQL
Using TimeStamp columns to keep track of database record versions
2011-10-07 // http://pagead2.googlesyndication.com/pagead/show_ads.js Timestamp is a value that is incremented by the database whenever an insert or update operation is performed. Even though the name Timestamp could be a bit misleading, this value has no relevance to a clock related time. This only shows a linear progression of time. For an example , it isContinue reading “Using TimeStamp columns to keep track of database record versions”
How to use (escape) single quotation mark in sql statements
06-10-2011 // http://pagead2.googlesyndication.com/pagead/show_ads.js We all get that day when we get an exception complaining about the single quotation or apostrophe that was in our SQL statement. The best advisable thing to do is to use stored procedures so that all data are passed as parameters. However there are situations we have to use in-line SQLContinue reading “How to use (escape) single quotation mark in sql statements”
A stored procedure that can auto-genarate SQL queries using exec method
06-10-2011 http://pagead2.googlesyndication.com/pagead/show_ads.js Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send the table name as a parameter? Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send only the condition but also the column name you want to include inContinue reading “A stored procedure that can auto-genarate SQL queries using exec method”
How to (Full and Transaction Log) backup and restore a database in Microsoft SQL Server 2005
2008-12-04 In this article I will discus how to backup a database as a FULL backup or with Transaction Log (Tail Log) backup and how to restore the database, how to recover transactions made after you taking the backup, etc. Since it is not easy to use and organize images in the post itself IContinue reading “How to (Full and Transaction Log) backup and restore a database in Microsoft SQL Server 2005”