Reputation
946
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
1 10 23
Impact
~95k people reached

Jun
29
comment How does SQL Server choose an index key for a foreign key reference?
@AaronBertrand: here's why I was asking if it was a bug: on SQL Server 2005, the behavior always chooses the primary key. On 2008, it chooses the primary key the first time if the primary key if the primary key is clustered. The behavior appears consistent, which is why it seems weird. But from what you're saying, it sounds like nobody but the programmers will ever know.
Jun
29
comment How does SQL Server choose an index key for a foreign key reference?
It makes sense...but the behavior is only on SQL Server 2008 R2 (not 2005, it's a complicated mess how I know all this), so I'm still leaning towards "potential bug."
Jun
29
comment How does SQL Server choose an index key for a foreign key reference?
I may not be understanding, but if I create primary key on the table as a clustered index in the example above, it will not use the duplicate index key as a reference (and the duplicate can be deleted). This appears to be related to it being a heap first...
Jun
26
comment How to log error details when using using try/catch for dynamic SQL backup commands
You may want to see this: stackoverflow.com/questions/5966670/…
Jun
24
comment How can I check the integrity of disabled foreign key relationships for each individual table? (SQL Server 2008)
Will your tables have primary keys or unique keys that you can use as references for the foreign keys? You won't be able to build these disabled foreign keys (in your example) without them.
Jun
16
comment How to efficiently check EXISTS on multiple columns?
@Thomas: Welcome to Stack Exchange. Have watched your SQL Bits Extreme DW presentation about twenty times.
Apr
30
comment ETL: extraction strategy for 200 source databases
Thanks for the detailed answer. Do you have any thoughts on using replication as a low impact means of mirroring the source data?
Feb
17
comment Data warehouse: using day number in Epoch in a date dimension
Interesting. In the example in the book, the last column in the date dimension is a SQL Date Stamp. So if Epoch means the same thing, I'm not sure why both would be included. But if Epoch is a timestamp, then what would "Day Number in Epoch" represent?
Aug
11
comment Adding columns to production tables
Recent article regarding this problem: sqlservercentral.com/articles/Change+Tracking/74397
Jul
21
comment Does adherence to the DRY principle justify dynamic SQL?
My example is pretty simplistic, but for a more complex query that involved the usage of indexes, would the above approach open you up to parameter sniffing?
Jul
20
comment Should I convert empty varchar values to NULL?
The developer for the middle tier has offered to implement a method that will convert all empty strings to NULL. I'm wondering though, is it the responsibility of the database to ensure this consistency? Or is it my responsibility to represent what was submitted (correct or not)?
Jul
20
comment Should I convert empty varchar values to NULL?
@MartinSStoller: do you a think it would be better to block these empty strings through an error message? In the context of this particular data, an empty string will not have meaning to the user.