[Updated]: Light weight SQL Server procedure auditing without using SQL Server auditing version 0.3.0.0

  (The new solution can be downloaded here) (The detailed Information of the solution is mentioned here) After having seeing the solution settled in numerous projects and getting great feedback from you, I added the following request to the solution. Out-of-transaction support for Procedure Logging While you might run the logging within your own crafted…

0

Update to SQLCmdScriptExpander => 0.2.0.0 is out

(Updated version available here) As suggested by M Merrill in my former post of SQLCMDScriptExpander (which can be found here), I added an option for providing the encoding of files. So I created another option where you can specify the encoding from the following options: /Encoding:[  ASCII |                     BigEndianUnicode |                     Default |                    …

6

Bulk Backup and Restore at the tip of your finger

(Code can be downloaded here) (A newer version of the code can be downloaded here) The Backup part “Can you please give me a recent backup of all user databases on that computer please ?” That is the sentence that will delay your planned work for the afternoon and will keep you busy for numerous…

14

IsGuid or not isGuid, that is the question…

As I was asked about a functionality how to check a string for being of the type GUID and only finding either solution with massive string operations, or using TRY..CATCH trying to CAST a value and then returning the CAST or CONVERT result, I created a new and simple one, based on a simple pattern…

2

Get the NULL percentage of values in a specific table dynamically

  Nothing really fancy, but a small script I was now asked twice for. So I thought I publish it for the public and for the reference for others. It simply calculates the percentage of NULL values for a specific table in all columns. The last request was originated from the post here. Be aware…

4

Expand :r referenced files for SQLCMD into one file (SQLCmdScriptExpander)

(Updated version available in this blog post) How can we expand files from a .sql file referenced with the :r operator ? Ok, lets make a step back in the past and see how we used to reference files in .sql files and calling them via OSQL or ISQL. The answer is, we couldn’t. We…

5

Cannot find the source of a SQL Server error ?

Ever had an error in your application and you couldn’t find the source of all evil and where the error is thrown at the end ? Well, SQL Server profiler does a great job about that, but you really need to understand which events to filter for and how to correlate the results in order…

0

Database Programming: Did You Know IN Can Do This?

Ward Pond, one of the marvelous SQL geeks within Microsoft published a nice thing wich we had a discussion internally on concerning the capabilities of the IN operator: http://blogs.technet.com/wardpond/archive/2009/09/04/database-programming-did-you-know-in-can-do-this.aspx Were you aware of that ? 🙂 Be also aware of the facts that NULL can change the expected results ! http://blogs.msdn.com/jenss/archive/2009/05/25/the-magic-about-trustable-relationships-with-null-and-not-in.aspx -Jens

1

Light weight SQL Server procedure auditing without using SQL Server auditing

(UPDATE: Updated technical version is available through this blog post here. The basic information and background though is available in the blog post you are reading) A week ago a colleague asked for different options to do audit stored procedure calls. With his allowance I will post the question here. “The applications used at the…

6

The “magic” about trustable relationships with NULL and NOT IN

  As a follow-up to my former post “Why you shouldn’t´trust the friendship of NULL and the (NOT) IN predicate” I asked Paul Randal during our SQL Server Master training about the possible internal reason that the results can vary if you have NULL in the IN-list. The explanation is that easy that I did…

1