Reputation
32,998
Next tag badge:
503/400 score
72/80 answers
Badges
8 85 145
Newest
 Necromancer
Impact
~1.1m people reached

2h
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.
18h
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
18h
comment select n values per group
Is this a documented, guaranteed technique in MySQL?
19h
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
Jul
11
comment nvarchar(max) converting to varchar and table optimization
That is still the estimated plan - Not the actual. The actual execution plan has information about actual rowcounts. I'm not sure why the plan shows full text operators as you don't seem to be using any full text syntax. Is the column SubType full text indexed?
Jul
11
comment Multiple indices on a table
Well clearly you want to set up your index in the order that makes it easiest to satisfy your queries. i.e. colum with equality condition first.
Jul
10
comment Query takes longer as domain user than local admin
Is the query parameterised? What do the execution plans look like? Particularly the compiled vs runtime value of the parameters. Different logins can share each other's plans as long as they both use the same default schema or the query doesn't rely on implicit resolution and various other session options such as default language are the same.
Jul
10
comment Multiple indices on a table
With the classic Phone book example (composite index lastname, firstname) - Look for all people with lastname equal to "Smith" and later or equal than "Martin" is pretty easy but looking for people with lastname >= "Smith" and firstname="Martin" much less so.
Jul
10
comment Multiple indices on a table
The queries you've shown have a >= not = for all columns...
Jul
10
comment Multiple indices on a table
So an index on InstanceId, Created, UserId would be equally good for query 1 and also satisfy query 2.
Jul
10
comment Multiple indices on a table
What is the query that misses index 1? Does it do an equality predicate on all three columns?
Jul
10
comment Can CLR execution continue after 'THROW' is encountered in T-SQL?
What happens if you read the stream to the end?