THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » sql » SQL Server   (RSS)
  • Defensive database programming: eliminating IF statements.

    The following pattern is quite common in database programming: IF EXISTS(some query) BEGIN   DO SOMETHING; END When such code runs in high concurrency situations, it may not work as expected. I will provide a repro when such logic fails 40% of the time. The following script provides a test table and attempts to ...
    Posted to Alexander Kuznetsov (Weblog) by Alexander Kuznetsov on November 27, 2008
  • SSIS: living in a parallel world? Not yet...

    Today I come into a nice bug (misfeature?) of SSIS 2008 and I'd like to share it with you. Let's start from the beginning: One of the keys to make something speedy is to parallelize it. In TableDifference I read from two inputs, compare them and produce several outputs for new, deleted, updated rows and so on. It is the classical ...
    Posted to Alberto Ferrari (Weblog) by AlbertoFerrari on September 14, 2008
  • Performance of inserts and IGNORE_DUP_KEY

    If your data has a small percentage of duplicates, then IGNORE_DUP_KEY may speed up your inserts. For larger amounts of duplicates, IGNORE_DUP_KEY may slow them down significantly. I set up two tables, stripping down all the irrelevant details, as follows:   CREATE TABLE t1(n INT NOT NULL PRIMARY KEY) GO CREATE TABLE ...
    Posted to Alexander Kuznetsov (Weblog) by Alexander Kuznetsov on July 30, 2008
  • Visio and SQL Extended Properties: a tool to marry them

    Visio database models have column descriptions, SQL Server has extended properties where to store them but, even if they share the same producer, it seems that Visio is unable to store column descriptions in extended properties so that other tools can gather the same information easily and produce a decent documentation of a database. After some ...
    Posted to Alberto Ferrari (Weblog) by AlbertoFerrari on November 7, 2007
  • SQL: Merge two "history tracking" tables

    If you have two columns in a table that ''remember'' their old values in two different historical tables, as it is the case in AdventureWorks with EmployeePayHistory and EmployeeDepartmentHistory, you may need (or just wonder how) to merge these two tables into only one historical table that will keep track of both columns. This has ...
    Posted to Alberto Ferrari (Weblog) by AlbertoFerrari on October 15, 2007
Privacy Statement