Do you use this
IF (SELECT COUNT(*) FROM SomeTable
WHERE SomeColumn = SomeValue ) > 0
Or do you use this
IF EXISTS (SELECT * FROM SomeTable WHERE SomeColumn = SomeValue )
If you answered COUNT(*) then maybe you should take a look these two articles
Andrew Kelly has a nice post on SQLBlog
Matija Lah has a good post on his snaps & snippets blog
BEGIN TRY BEGIN TRAN --put queries here COMMIT; END TRY BEGIN CATCH IF @@TRANCOUNT>0 BEGIN SELECT @@ERROR,ERRO...
Here are some of the string formats that you can try out: Specifier type output (June 8, 1970 12:30:59) dd Day 08 ddd ...
One of my friends contacted me recently and said they needed some help creating a stored procedure that imported data from a text file. They...
How to find the all child of particular parent using the Recursive Query --here we are creating the table variable so that we can insert so...