Reputation
31,198
Next tag badge:
481/400 score
71/80 answers
Badges
8 78 131
Newest
 Nice Answer
Impact
~894k people reached

Mar
27
comment sql querying for a pattern
@AaronBertrand - Thanks!
Mar
27
revised sql querying for a pattern
added 29 characters in body
Mar
27
answered sql querying for a pattern
Mar
26
comment Is there a faster way of moving rows of data between SQL Server databases than using CTE's?
You might be better off creating a poor man's partitioning scheme with a table per day in your live database for your 4 most recent days and a partitioned view to consolidate them (can't use table partitioning on express). Then change the definition of the view to bring in a new day and remove an old, insert to the archive DB and drop the now surplus table.
Mar
24
comment Efficient way to transpose large categorical column to one-hot table row
Can you show a cut down example? (E.g using varchar(20))
Mar
18
comment No value to update but still an TABLE UPDATE Operator
Just use UPDATE sample SET name='cat' WHERE id=@id; - if no rows are found to update nothing will be updated.
Mar
17
comment Isolation of SQL Server UPDATE
@RossPresser - Yes to the first example, see the index intersection piece here blogs.msdn.com/b/craigfr/archive/2007/05/02/…. For the second I guess potentially it could if two different committed versions were available. Not sure it would be possible to engineer in practice.
Mar
15
awarded  Enlightened
Mar
15
awarded  Nice Answer
Mar
14
comment Isolation of SQL Server UPDATE
@Tesh yes I don't think it would be possible to get any other result as that would all be on the same page and protected by a latch during the write.
Mar
14
comment Make SqlClient default to ARITHABORT ON
@HenrikStaunPoulsen - Unless you are stuck using 2000 (or 2000 compatibility level) it doesn't make any difference though. It is implied by ANSI_WARNINGS on in later versions and things like indexed views work fine.
Mar
14
comment Isolation of SQL Server UPDATE
@Tesh - I'm not sure what you are asking. This isn't the only similar scenario that is possible with NOLOCK I've added another one.
Mar
14
revised Isolation of SQL Server UPDATE
added 1047 characters in body
Mar
13
comment Isolation of SQL Server UPDATE
@srutzky - The question only asks about rows though. Which are logical not physical so providing an example where two different physical objects were involved in stitching together the row seems valid?
Mar
13
answered Isolation of SQL Server UPDATE
Mar
7
comment SQL Server - how transactions and transaction log work (simplified)
@TheGameiswar yes, as long as you aren't using delayed durability.
Mar
6
comment SQL Server: Recursive dynamic SQL puzzle
@user16484 the KB article only mentions order by but the responses on the connect site indicate this is not supported or guaranteed ever. Some example quotes here stackoverflow.com/a/15163136/73226 especially Even without ORDER BY, we do not guarantee that @var = @var + will produce the concatenated value for any statement that affects multiple rows. The right-hand side of the expression can be evaluated either once or multiple times during query execution and the behavior as I said is plan dependent.
Mar
6
comment Average of a row or record across three columns
@shrx no sorry. I have rarely used sqllite.
Mar
5
comment Cursor doesn't print text when I tell it to
Yes you can. screenshot of it all working fine
Mar
4
revised What's the difference between a temp table and table variable in SQL Server?
added 448 characters in body