SQL SERVER – SELECT 1 vs SELECT * – An Interesting Observation

Many times I have seen issue of SELECT 1 vs SELECT * discussed in terms of performance or readability while checking for existence of rows in table. I ran quick 4 tests about this observed that I am getting same result when used SELECT 1 and SELECT *. I think smart readers of this blog will come up the situation when SELECT 1 and SELECT * have different execution plan when used to find existence of rows.

Read More

SQL SERVER – Msg: 2593 : There are ROWCOUNT rows in PAGECOUNT pages for object ‘OBJECT’.

There are ROWCOUNT rows in PAGECOUNT pages for object ‘OBJECT’.

This message is displayed when DBCC command is ran for any database. It is harmless and displayed for information purpose only. For each database DBCC commands displays number of rows and number of pages it is using. DBCC CHECKALLOC is exception for this messages.

Read More

SQL SERVER – FIX : ERROR : Cannot find template file for new query (C:\Program Files\Microsoft SQL Server\90\Tools\ Binn\VSShell\Common7\ IDE\sqlworkbenchprojectitems\Sql\ SQLFile.sql)

Just a day ago while playing with SQL Server I suddenly faced a new kind of error, which I have never seen before. This error happens when clicked on New Query in SQL Server Management Studio. Let us learn in this blog post how we will fix the error – cannot find template file for a new query. 

Read More