Reputation
12,670
Next tag badge:
85/100 score
18/20 answers
Badges
5 35 76
Impact
~458k people reached

1d
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
Jul
8
answered What is the difference between Used and Allocated space?
Jun
2
comment What is the optimal way to design an approval queue and audit trail for entities in SQL Server 2008 R2?
@AlexandreJobin You need to either filter on the active bit (since only one customer can be active) or have two customerIDs since it's obviously not a unique identifier.
May
27
awarded  Yearling
May
6
comment Replacing a Cursor with a single Query possible?
What RDBMS? In SQL Server this should be easily done with CTEs and windowing functions like ROW_NUMBER().
Apr
24
awarded  Nice Question
Apr
23
awarded  Nice Answer
Apr
15
comment Is the table in 3NF?
No, because title and author info are dependent on the isbn...You need a separate books table with the book info.
Apr
10
awarded  Famous Question
Apr
8
awarded  Popular Question
Mar
17
comment Joining two inline functions, slows considerably when filtering on second function
If you add a WHERE for that, it makes this an INNER join instead of an outer join. You're actually changing the shape of the plan.