Query I/O over the Last Five Minutes
When faced with a SQL Server that is performing poorly, a great starting place for troubleshooting is looking at wait stats. Once you’re gathering wait stats, if you see lots of IO-related waits, you may…
Common data-type conversions between SQL Server, Oracle, Sybase ASE, and DB2.
SQL Server includes a little-known, but handy, function that can show you common data-type conversions for a target system; useful for ETL between disparate systems. Run this code:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
DECLARE @source_dbms sysname = N'%' , @source_version sysname = N'%' , @source_type sysname = N'%' , @destination_dbms sysname = N'%' , @destination_version sysname = N'%' , @destination_type sysname = N'%' , @defaults_only bit = 0; SELECT * FROM sys.fn_helpdatatypemap ( @source_dbms , @source_version , @source_type , @destination_dbms , @destination_version , @destination_type , @defaults_only ); |
The above code returns a result-set…
Detect Microsoft .Net Framework versions
I use the following code to determine which specific version of the Microsoft .Net Framework 4.0 is installed on my SQL Server. It detects versions from 4.5 to 4.7, and can be easily extended as…
Wait Stats capture script
Performance troubleshooting should begin with capturing wait stats so we can understand where SQL Server is busy. The script below captures wait stats into a table in tempdb; the script should be ran via a…
Mimic Production in Development
Attempting to debug production performance problems in your development environment can be problematic in many ways, leading to a frustrating troubleshooting experience. One very common situation is the resources on the development environment are substantially…