Reputation
Next tag badge:
572/400 score
77/80 answers
Badges
8 103 162
Newest
 Enlightened
Impact
~1.6m people reached

Apr
13
awarded  Enlightened
Apr
13
awarded  Nice Answer
Apr
3
answered how to find the T-SQL of a sleeping session that is blocking some other process?
Apr
2
answered Is there a way to have multiple error messages displayed with RAISERROR conditionally?
Apr
1
comment what are the costs of enabling extended events?
Deadlocks are captured in the system health extended events session which is enabled by default anyway. You can extract them eg. with dba.stackexchange.com/questions/10644/…
Mar
28
revised Hold exclusive lock on a whole DB
Good info that should be in the answer
Mar
27
revised Why are Denali sequences supposed to perform better than identity columns?
deleted 243 characters in body
Mar
25
comment Buffer Run Error
Someone else posted that simply running checkdb appeared to silently fix things here geertvanhove.wordpress.com/2011/09/16/…
Mar
25
comment Buffer Run Error
Possibly I haven't seen that error before. I'd run checkdb as suggested in the error message. SP3 is available too which may or may not help depending on the underlying cause.
Mar
25
comment Buffer Run Error
Does the code you posted actually reproduce the problem in the problematic instance? I.e it is reproducible at will with a new table thus ruling out corruption as a likely cause?
Mar
25
comment Query Time is doubled because of a column in select
And guessing the string length is max 400 bytes per row even if nvarchar and making a generous allowance for @sUrlHeader that means an extra 49 MB of data acrosss 121919 rows - are you on an extremely slow connection?
Mar
25
comment Query Time is doubled because of a column in select
The following takes 3 seconds for me. SELECT MAX(X) FROM (SELECT TOP 121919 FORMAT( DATEADD(DAY,CRYPT_GEN_RANDOM(2)+0,GETDATE()), 'dd-MMM-yyyy HH:mm:ss') FROM master..spt_values V1, master..spt_values V2)T(X). Can you provide a full repro that we can run?
Mar
20
revised Is NOLOCK always bad?
added 363 characters in body
Mar
20
revised Could not continue scan with NOLOCK due to data movement
added 151 characters in body
Mar
16
comment SARGable WHERE clause for two date columns
Is the only reason for avoiding the computed column because you have connections using the wrong ansi settings? If so you could create a normal column and update it with the correct computed value using triggers.
Mar
10
awarded  Announcer
Mar
10
awarded  Good Answer
Mar
6
comment Add a primary key constraint to an existing unique column
ALTER TABLE ... SWITCH allows you to go from a unique index to a unique constraint. But neither of these allow you to switch to a PK constraint - even when the column is not nullable and the supporting index has the same clustered/nonclustered specification. But it looks like you don't need to do this anyway stackoverflow.com/a/4000659/73226
Mar
5
answered Correlated Subquery in SQL Server 2014
Feb
21
comment What's the difference between a temp table and table variable in SQL Server?
@srutzky thanks, Most of the CLR functions I have written don't do data access so I'm not massively familiar with the restrictions there.