SQL SERVER – Find Number of Rows and Disk Space Reserved – Using sp_spaceused Interesting Observation

Previously I posted SQL SERVER – Find Row Count in Table – Find Largest Table in Database – T-SQL. Today we will look into the same issue but with some additional interesting detail. We can find the row count using another system SP sp_spaceused. This SP gives additional information regarding…
Read More

SQL SERVER – 2008 – 2005 – Find Longest Running Query – TSQL

UPDATE : Updated this query with bug fixed with one more enhancement SERVER – 2008 – 2005 – Find Longest Running Query – TSQL – Part 2.
Recently my company owner asked me to find which query is running longest. It was very interesting that I was not able to find any T-SQL script online which can give me this data directly. Finally, I wrote down very quick script which gives me T-SQL which has ran on server along with average time and maximum time of that T-SQL execution. As I keep on writing I needed to know when exactly logging was started for the same T-SQL so I had added Logging start time in the query as well.

Read More

SQL SERVER – 2008 – Interview Questions and Answers – Part 8

Click here to get free chapters (PDF) in the mailbox SQL SERVER – 2008 – Interview Questions and Answers Complete List Download What is Data Compression? In SQL SERVE 2008 Data Compression comes in two flavors: Row Compression Page Compression Row Compression Row compression changes the format of physical storage…
Read More