Thursday, April 29, 2010

SQL Server 2008 System Functions to Monitor the Instance, Database, Files, etc.

SQL Server provides several system meta data functions which allow users to obtain property values of different SQL Server objects and securables, for example
  • SERVERPROPERTY
  • DATABASEPROPERTY
  • FILEGROUPPROPERTY
  • FILEPROPERTY
  • OBJECTPROPERTY
  • COLUMNPROPERTY
  • INDEXPROPERTY
  • CONNECTIONPROPERTY
  • SESSIONPROPERTY
Although you can also use the SQL Server catalog views or Dynamic Management Views to obtain much of this information, in some circumstances the system meta data functions simplify the process. In this tip I am going to demonstrate some of the available system meta data functions and their usage in different scenarios, for more details click here.

Understanding Dynamic Management Views and Functions in SQL Server 2008

Performance monitoring and optimization is an inseparable part of a DBA's activities. To optimize a poorly performing system/query or to troubleshoot the performance issues you need to know the root cause. Prior to SQL Server 2005, we had several system tables to monitor the state of the system. Though these system tables are still available in SQL Server 2005 and in later versions but SQL Server 2005 introduced whole new set of Dynamic Management Views (DMV) and Dynamic Management Functions (DMF) to monitor the health of a SQL Server instance, diagnose and tune the performance issues. For details, click here.

SQL Server CROSS APPLY and OUTER APPLY

SQL Server 2005 introduced the APPLY operator, which is very much like a join clause and which allows joining between two table expressions i.e. joining a left/outer table expression with a right/inner table expression. The difference between join and APPLY operator becomes evident when you have a table-valued expression on the right side and you want this table-valued expression to be evaluated for each row from the left table expression. In this tip I am going to demonstrate what APPLY operator is, how it differs from regular JOINs and what are few of its applications, for more details click here.