712 reputation
414
bio website
location
age 31
visits member for 2 years, 8 months
seen yesterday
sql must be lowercase.

Jul
26
comment Passing NULL xml value to a certain CLR stored function crashes it when called in a certain way
@AaronBertrand I believe you misread the code; TestTest is scalar and is called as such, WillBeCalledByCLR is TV and is also called as such (with exists), no CLR-specific magic here. As for fixes, yes, the company is slow about fixes because they are believed to not only fix, but also amend and brake. Would actually be nice if this behaviour was confirmed as nonexistent on 2012, as it was last time.
Jul
26
comment Passing NULL xml value to a certain CLR stored function crashes it when called in a certain way
@AaronBertrand I call it from a case that returns single value, but even if I didn't scalar would still be okay as it is documented to return first value of first column and ignore the rest. Edited in version.
Jul
26
revised Passing NULL xml value to a certain CLR stored function crashes it when called in a certain way
added 217 characters in body
Jul
26
asked Passing NULL xml value to a certain CLR stored function crashes it when called in a certain way
May
13
awarded  Caucus
Mar
27
answered How long does it take to do RESTORE WITH NORECOVERY
Dec
21
comment Inline table-valued function vs inline sql
the overall shape is quite different -- please be more specific here.
Dec
19
awarded  Yearling
Oct
31
comment SQL Server 2008 Performance issue with very strange resolution
> In order to find out what is running or going on, I have to run a batch--which makes the problem stop. SO the act of trying to observe the issue resolves it.
Sep
21
awarded  Custodian
Sep
6
accepted CATCH block is triggered when it should not
Sep
6
comment CATCH block is triggered when it should not
@AlexKuznetsov Ultimately, errors that client must see are passed to the client. But there are errors that require internal work. Passing them to the client would imply relying on the client to do that work, and that breaks the incapsulation. The database is not an exclusive data storage only used by one application. Many types of clients can connect.
Sep
6
comment CATCH block is triggered when it should not
Makes sense to me. The context of a try block erroneously survives, so the error functions can return their values, and another consequence would be that an error brings execution into the handler of the erroneously survived try context.
Sep
6
comment CATCH block is triggered when it should not
@gbn Are you saying this is a bug in 2008 that has been fixed in 2012? Is there an entry on connect?
Sep
6
comment CATCH block is triggered when it should not
@gbn When specifically applied to transactions, yes, it does (the template is going to be a bit more complex though, as we have sort-of-okay errors that give XACT_STATE() = 1, so we rollback to a save point and carry on). But I'm more concerned about the very principle of error handling here, even when to transactions are present. Any code after commit_and_exit: is going to execute twice.
Sep
6
reviewed Reject suggested edit on CATCH block is triggered when it should not
Sep
6
asked CATCH block is triggered when it should not
May
7
accepted Associate a piece of data with a session
May
7
comment Associate a piece of data with a session
I'm happy with a separate table as long as I can clearly tell apart live data from expired data. SPID is not really good because it is reused, but if it is only used for nightly cleaning and not for fetching data, then it's going to be fine.
May
7
comment Associate a piece of data with a session
I thought about that, but then we're back to the problem of cleaning up expired data? No wait, we're not. The data will not delete itself, but will not get used by any subsequent connections... Yes, that's an option.