Reputation
13,710
Next tag badge:
89/100 score
18/20 answers
Badges
5 38 82
Newest
 Enlightened
Impact
~644k people reached

2d
awarded  Enlightened
2d
awarded  Nice Answer
Feb
14
awarded  Enlightened
Feb
14
awarded  Nice Answer
Feb
1
awarded  Taxonomist
Jan
28
awarded  Nice Answer
Nov
4
awarded  Popular Question
Oct
30
awarded  Popular Question
Oct
5
comment How to avoid deadlocks when running queries on a remote server
The WHERE clause can also cause a key lookup operation (which is basically guaranteed if you use SELECT * and the WHERE is not covered by the CI), and key lookups can lead to deadlocks since it's technically two operations.
Sep
22
awarded  Popular Question
Sep
4
awarded  Great Answer
Aug
4
comment Compound Primary Key - Index both fields?
I disagree that "Index on UserID alone is useless". There are definitely use cases for a narrow NC index that overlaps in part with a wider CI. The narrow NC index will be a LOT faster to do seeks on, especially if you aren't pulling data from the row beyond the userid.
Aug
4
comment How To Manage Random Data Without Repitition?
This is very hard to follow. It should be fairly easy to handle by having a questions table (which you don't seem to list) and a UserQuestions table that you insert into before showing the questions. If UserQuestions has a unique constraint on (UserID, QuestionID) it will be impossible to have the same question for the same user more than once.
Aug
4
comment Real-world scenarios for table with DENY SELECT and GRANT [INSERT/UPDATE/DELETE]
Off the top of my head, I could see a table that you were allowed insert but not select for tracking financial transactions. You may need to log that an expense occurred but not have permission to see everyone else's transactions. Functionally I think this is probably silly since these functions should be encapsulated in stored procedures or UDFs and permissions controlled on those objects.
Aug
4
comment Why does PK constraint require a separate index when I already have a suitable unique clustered index?
@MikaelEriksson it is in other versions of SQL Server
Aug
4
comment Why does PK constraint require a separate index when I already have a suitable unique clustered index?
@ypercube azure does not support heaps apparently: social.msdn.microsoft.com/Forums/azure/en-US/…
Aug
4
awarded  Constituent
Aug
3
comment Select statements during long update
You can also always consider batch updates. If you use a TOP(10000) in the update, it'll just do that many records at once. Do this in a WHILE loop until no rows are updated.
Aug
1
awarded  Nice Answer
Jul
27
awarded  Caucus