Code Repository


This page is a repository for the code found in some of my blog posts.
If you like my code, feel free to download it and use it.
CodePost
sp_Template.sqlMy stored procedure code template
dba_runCHECKDB.sqlSetting up an e-mail alert for DBCC CHECKDB errors
dba_ForEachDB.sqlA better sp_MSForEachDB
verify_script.sqlHow to Eat a SQL Elephant in 10 Bites
CustomDateFormat.csSQL Server and Custom Date Formats
formatDate_Islands_iTVF.sqlSQL Server and Custom Date Formats
formatDate_Recursive_iTVF.sqlSQL Server and Custom Date Formats
formatDate_scalarUDF.sqlSQL Server and Custom Date Formats
parseDate_Islands_iTVF.sqlSQL Server and Custom Date Formats
Archived WordPress comments (4)

Historical comments from the original site; this archive is read-only.

  1. David Warner
    Good Morning,
    I have had an issue with the pre-2012 version of the DBCC CheckDB script ... in the Catch statement on line 279 I have had to insert the error handling that you provide as part of lines 439 to 446 ... my error was that TempDB wasn't sized correctly and the only error I received was "The current transaction cannot be committed and cannot support operations that write to the log file. Roll back the transaction. [SQLSTATE 42000] (Error 50000)" with the additional error handing it logged the reason for the job failure as lack of space in TempDB. Aside from that it is extremely useful piece of code! :-D
    1. spaghettidba
      Good to hear!
      I hope you solved your issues with the new version.
  2. Dirk
    Bad link (sp_Template.sql) - did not check the others
    1. spaghettidba
      Thanks for the heads-up! It was Dropbox that decided to change permalinks. Got rid of them and use gists now. Thanks again!