How do you find Fragmentation Information for a table in SQL Server 2005? DBCC SHOWCONTIG has limits, so I use sys.dm_db_index_physical_stats instead.
SQL SERVER – 2005 – Last Ran Query – Recently Ran Query
Want to see the last ran query on SQL Server 2005? This quick script uses sys.dm_exec_query_stats to list recent queries with the time each one ran.
Comparing Server Settings Across Instances
Comparing server settings across SQL Server instances shows configured and live values, so you can judge which differences affect a workload.
SQL SERVER – Importance of Master Database for SQL Server Startup
I have received following questions. I will list all the questions here and answer them together.
What is the purpose of Master database?
SQL SERVER – 2005 – Get Current User – Get Logged In User
How to get current user for a query in SQL Server 2005: SELECT SYSTEM_USER returns the name of the current context, which helps with debugging and security.
SQL SERVER – Get Permissions of My Username / Userlogin on Server / Database
Invited to review a big company’s schema, I wanted to know my own permissions without asking their DBA. fn_my_permissions shows them at server and database level.
SQL SERVER – Difference Between @@Version and xp_msver – Retrieve SQL Server Information
SELECT @@Version gives the SQL Server version, edition and service pack in one string. I compare @@Version and xp_msver, which returns more server details.







