Joseph Michael Pesch
VP Programming

MS CRM Diagnostics

by 24. February 2011 16:33

 Create a platform trace by doing the following steps

·         Run the CRM diag tool on the CRM server.

·         In the Platform Tracing Section click to change the button to Enabled.

·         Recreate the issue by editing the attribute Requirement level and saving it.

·         In the Platform Tracing Section click to change the button to Disabled.

·        

To get the crm_server_report_information.

·         Download the new tool on to the crm servers

·         Select the Dynamics CRM Server from the dropdown

·         On the section Troubleshooting file for support

·         Click on Create file

 

NewCrmDiagTool4.zip (397.56 kb)

Tags:

MS CRM

ExecuteScalar() Truncates Xml Using SQL For Xml

by 24. February 2011 07:51

Use this style as the Sql server actually returns multiple rows of the Xml in 2,033 byte chunks:

System.Xml.XmlReader rdr = cmd.ExecuteXmlReader();
rdr.Read();
while (rdr.ReadState != System.Xml.ReadState.EndOfFile)
  xml.Append(rdr.ReadOuterXml());

Tags:

ASP.Net | SQL Server

SQL Database Summary Query

by 23. February 2011 15:03

SELECT

  vfs.database_id,

  DBName = DB_NAME(vfs.database_id),

  DB_Reads = SUM(vfs.num_of_reads),

  DB_Writes = SUM(vfs.num_of_writes),

  DB_BytesRead = SUM(num_of_bytes_read),

  DB_IOStallReadMS = SUM(io_stall_read_ms),

  DB_BytesWritten = SUM(num_of_bytes_written),

  DB_IOStallWriteMS = SUM(io_stall_write_ms),

  DB_IOStall = SUM(io_stall),

  DB_BytesSize = SUM(size_on_disk_bytes),

  DB_Files = dt.file_list

FROM sys.dm_io_virtual_file_stats(NULL, NULL) vfs

JOIN(

  SELECT

    vfs2.database_id,

    STUFF((

    SELECT ',' + mf3.name AS [text()]

    FROM sys.dm_io_virtual_file_stats(NULL, NULL) vfs3

    JOIN sys.master_files mf3 ON mf3.database_id = vfs3.database_id

      AND mf3.file_id = vfs3.file_id

    WHERE vfs2.database_id = vfs3.database_id

    FOR XML PATH('')

  ), 1, 1, '') AS file_list

  FROM sys.dm_io_virtual_file_stats(NULL, NULL) vfs2

  JOIN sys.master_files mf2 ON mf2.database_id = vfs2.database_id

  GROUP BY vfs2.database_id, DB_NAME(vfs2.database_id)

) dt ON dt.database_id = vfs.database_id

GROUP BY vfs.database_id, DB_NAME(vfs.database_id), dt.file_list

ORDER BY DB_NAME(vfs.database_id)

 

Excerpt from: http://www.sqlmag.com/article/tsql3/nifty-ways-to-use-for-xml-path-concatenation.aspx

Tags:

SQL Server