Browse by Tags

Tagged Content List
  • Blog Post: 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...
  • Blog Post: 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...
  • Blog Post: 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 matching...
  • Blog Post: 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 that...
  • Blog Post: 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 needed to use either...
  • Blog Post: 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 to know where to...
  • Blog Post: 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 ...
  • Blog Post: 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...
  • Blog Post: 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...
  • Blog Post: A long (but not missed) friend revisited, prefixing stored procedures with SP_

    Coming as a simple sample with PBM (creating a policy with a condition that procedure names shouldn't´t start with SP_) and getting an interesting question in one of my classes, I wanted to revisit the question about the yet in some places existing naming convention of prefixing the procedure with SP_...
  • Blog Post: When is random “random enough” ?

    An interesting question came up in a private conversation. If you want to pick a random value from a random generated result set and want to make sure that the row is really random, is the known ORDER BY NEWID() really random enough ? The point is that once you have one value and knowing the algorithm...
  • Blog Post: Why you shouldn't´trust the friendship of NULL and the (NOT) IN predicate

    A colleague had a problem concerning a query using the (NOT) IN predicate, use the following table creation script (attached to the blog entry) to see the effects of the problem and to repro it on your machine. Imagine you have two tables (not that hard till here) and you want to get the information...
  • Blog Post: Determine the current status of a SQL Server Agent job

    Due to the problem that there is no definite table for getting information about the current status of jobs, I created a small procedure grabbing the information from parts of the internal procedures used to extract the very relevant information. As an (optional) parameter you can specify a jobname you...
  • Blog Post: Tedious trigger generation getting simplified

    While talking with a former colleague of mine, we were elaborating about methods for syncing databases in his company. After boiling down the scenario to a point where we excluded all sync technologies possible, we came down to good old triggers. As of his information he just needed to sync a subset...
  • Blog Post: Merge it your own way -- Followup on the test

      After publishing the first test results on a previous post I got in contact with the product team to followup the test results. After redoing the test on real hardware and in a client - server scenario, the following result could be extracted from the tests. As the following charts shows, the...
  • Blog Post: Get all system databases of a server

    The easiest way for querying all system databases of a server is to assume that databases create by a user come with a database_id >= 5 in sys.databases. But the problem is that distribution databsaes will not be kept into this consideration. Therefore SMO does the following behind the scenes (bioled...
  • Blog Post: Obfuscation is not a security feature – Spoofing the APP_NAME

    SQL Server 2005 introduced an interesting and long demanded feature, the LOGON triggers. First only defined via server event triggers, it has become more and more popular in same scenarios to prevent users with a certain machine environment accessing the server. I saw that implemented in forums as denying...
  • Blog Post: Merge it your own way - Comparison of SQLAdapter vs. SQLCommand vs. MERGE

    The question which always comes up in my sessions about SQL Server 2008 is according to my most loved feature in SQL Server 2008, the MERGE command. People always ask me how the performance comparison with MERGE is compared to some standard / traditional mechanisms like SQLCommand / SQLDataadapter /...
Page 1 of 1 (18 items)