Reputation
33,523
Next tag badge:
506/400 score
72/80 answers
Badges
8 87 147
Newest
 sql
Impact
~1.1m people reached

Aug
23
comment Which command Deletes and Frees Space
What is the definition of the Contact table? Is it a heap or does it have a clustered index?
Aug
22
comment How to find the stored procedure which executed an event?
Extended events would allow you to see the whole TSQL call stack - but I don't think object_deleted is available in 2008. You could create a DDL trigger that logs additional information or that performs some action that is traceable with extended events though then use something like this
Aug
16
comment Trouble with a NOT IN query
The query you posted looks fine. Are you sure that's exactly what you were executing?
Aug
5
comment Why is FORCE JOIN option slowing down query and forcing execution plan to sort prior to joining tables?
@Synergist - These are just screen shots from SQL Sentry Plan Explorer TBH i wasn't expecting removing the TOP to improve things. Removing the row goal must have altered things in a lucky way.
Aug
5
comment Why is FORCE JOIN option slowing down query and forcing execution plan to sort prior to joining tables?
select top 100000 * from anchor won't give you deterministic results. What is the query supposed to be doing? Also table definitions including indexes?
Aug
5
comment How can I learn more about how SQL Server “normalizes” queries prior to creating the execution plan?
8606 gives you the trees before and after normalisation. A similar claim was made here dba.stackexchange.com/a/108863/3690
Aug
4
comment Why does PK constraint require a separate index when I already have a suitable unique clustered index?
Oracle has a "using index" clause for constraints I believe so they can be coupled to existing unique indexes. One use case for this in SQL Server would be to avoid having to create an unnecessary unique constraint in the supertype/subtype pattern. example here
Aug
3
comment Index performance on ON versus WHERE
Did the plan show an optimiser timeout?
Aug
3
comment Problem with clustered index? Or bad indexes? (SQL Server 2008 R2)
@Aaron pretty sure that 2005 behaved as above. Not sure about earlier versions. I don't have them installed anywhere to test either.
Aug
2
comment Problem with clustered index? Or bad indexes? (SQL Server 2008 R2)
@Aaron - This isn't the case. See i.stack.imgur.com/SpOf8.png. And regarding * vs constant see stackoverflow.com/a/6140367/73226
Aug
2
comment select n values per group
Is this a documented, guaranteed technique in MySQL?
Aug
2
comment Good, Bad or Indifferent: WHERE 1=1
@Paul - Thanks for the links to the docs.
Jul
20
comment How to full text search worked with special character like “of”?
it depends...
Jul
18
comment Index on a persisted computed column not seekable?
Please update this if you get any interesting response!
Jul
18
comment existing foreign key that references fields with different datatype (char(8) and varchar(8))
@Paolo - You'd be looking for "breaking changes" in the release notes for SQL Server 7 but I don't think much documentation is online for SQL Server prior to 2000.
Jul
18
comment existing foreign key that references fields with different datatype (char(8) and varchar(8))
@ypercube - From testing on 2005 with 6/6.5 compatibility mode this would not be allowed Columns participating in a foreign key relationship must be defined with the same length.
Jul
18
comment Database Maintenance Planner greyed out (disabled)
Any help? dba.stackexchange.com/q/12584/3690
Jul
18
comment existing foreign key that references fields with different datatype (char(8) and varchar(8))
@PaulWhite - Yep this test on 2005 shows it was preserved that long i.stack.imgur.com/2w7cj.png (2005 supported 60/ 65/70, 2008 just 80 up)
Jul
15
comment Effective indexing and querying of overlapping date/time ranges
How many rows will you typically have for each AccountId?
Jul
11
comment Overcome MERGE JOIN(INDEX SCAN) with explicit single KEY value on a FOREIGN KEY
Do your foreign keys have CASCADE action set? that affects the locks taken