Monthly Archives: March 2006

SQL server 2005 default trace

When SQL server 2005 is installed, it starts a default trace. Run the following query:   SELECT * FROM ::fn_trace_getinfo (0)   If you donot have any server side or sql profiler trace is ruuning, it still shows a trace. … Continue reading

Posted in SQL server 2005 | 1 Comment

OPENXML and namespace

When xml document has namespace, there is extra considerations to use OPENXML to get data from it.   Handling one namespace: declare @xmlDoc nvarchar(4000) SET @xmlDoc=’<ObjectList xmlns=""> <Version>1.0.0</Version> <ObjectOption>1</ObjectOption> <Object ObjectID="./2.3/2.3" IncludeDescendents="4"/> <Object ObjectID="./3.4/3.4" IncludeDescendents="1"/> <Object ObjectID="./2.8/2.8" IncludeDescendents="2"/></ObjectList>’   declare @i intexec sp_xml_preparedocument @i output, … Continue reading

Posted in SQL server | Leave a comment

sql 2005 dmv: Query OS information

SQL server 2005 exposes server states information by dynamic management views (DMV). In SQL 2000, it’s not easy to get server information. This can be easily done in SQL 2005 by means of an os DMV view: sys.dm_os_sys_info   The following query … Continue reading

Posted in SQL server 2005 | Leave a comment