707 reputation
410
bio website
location
age 31
visits member for 2 years, 4 months
seen Mar 24 at 13:26
sql must be lowercase.

Apr
10
revised How can I remove an index scan from a SQL Server SELECT statement?
formatting, English improved
Apr
10
suggested suggested edit on How can I remove an index scan from a SQL Server SELECT statement?
Feb
29
awarded  Enthusiast
Feb
22
accepted Save Transaction: Is the name local to the stored procedure or not?
Feb
22
comment Save Transaction: Is the name local to the stored procedure or not?
Right. Yes, that makes sense. The code needs another stare which it will get. But then, it's not that big, and in two days I haven't been able to find any possible way for the control flow to not hit both rollbacks, both by executing it in my head and pressing F11 repeatedly. Either someone is a moron or this needs to be properly reproduced and posted to connect. Thanks for your help.
Feb
22
comment Save Transaction: Is the name local to the stored procedure or not?
That is exactly what I cannot understand. If a rollback was stepped over for some reason, then surely switching to the newid() thing would not help? But it did help, and it's 100% reproducible; if I switch it back to the constant name, it is misbehaving always, and with the random name it is doing the right thing always.
Feb
22
comment Save Transaction: Is the name local to the stored procedure or not?
Ok. That makes sense. They are global and I've learnt that. But why does it work as naively expected in the example? Does the first rollback make it "forget" the savepoint, so that the second rollback rolls back to the previous savepoint of the same name? And if so, how came it didn't happen in production, where number of rollbacks equals number of save trans?
Feb
22
revised Save Transaction: Is the name local to the stored procedure or not?
typo
Feb
22
asked Save Transaction: Is the name local to the stored procedure or not?
Feb
19
comment Insert if not exists, concurrently
Possible duplicate of stackoverflow.com/questions/3407857/…
Feb
16
comment Filtered indices: Why include the filtered-on field?
@AlexKuznetsov To enforce uniqueness ignoring null fields, yes. Sometimes for actual queries though, at which point I have to test to see what filtered columns I will need to include.
Feb
15
accepted Filtered indices: Why include the filtered-on field?
Feb
15
comment Filtered indices: Why include the filtered-on field?
Yes, it sometimes does the right thing. For instance, it does the right thing in regard of dismantled in my example, I don't have to include it in the index.
Feb
15
comment Filtered indices: Why include the filtered-on field?
@a1ex07 How is rank not part of the index?
Feb
15
asked Filtered indices: Why include the filtered-on field?
Feb
10
answered Restrict SQL Server 2008 R2 User to restore only one database (but not others)
Feb
10
comment How does objectproperty() figure out if a function is deterministic in sql server?
@BrianDishaw I'm not sure, to be honest. Apparently because any data-accessing function is not deterministic unless schema bound, and SQL Server expands this behaviour to functions that don't in fact access data. Maybe it's not able to see they don't.
Feb
9
answered How does objectproperty() figure out if a function is deterministic in sql server?
Feb
8
comment Window functions cause awful execution plan when called from a view with external parametrized 'where' clause
@MartinSmith Yes, pretty much so.
Feb
8
comment Window functions cause awful execution plan when called from a view with external parametrized 'where' clause
One of the requirement was the query is consumable by end users using Excel (that is, by MS Query), and MS Query will not let you do that, at least in versions up to 2003.