28,280 reputation
771121
bio website
location United Kingdom
age
visits member for 3 years
seen yesterday

Email: stackoverflowmartinsmith@gmail.com


Sep
6
comment How to count the rows from 1 table but from two different column
@DChauhan Don't forget to accept an answer if your question is answered.
Sep
6
comment Remove a character from a records enclosed between double quotes
Why does your table have data like this? Why aren't you splitting this data out into columns at import time? e.g. With SSIS or open query and the text file driver.
Sep
3
awarded  Nice Answer
Aug
27
comment Why does my query end up with two seeks instead of one and how do I fix that?
Can you upload the plan or at least provide SQL that runs and reproduces the issue? Current SQL is invalid/
Aug
26
awarded  Necromancer
Aug
18
awarded  Good Answer
Aug
14
comment Why is it @@SERVERNAME but not @@DBNAME?
The @@ ones used to be known as global variables and that syntax goes back to Sybase days. Same with @@IDENTITY vs SCOPE_IDENTITY
Aug
9
comment Script that alters all stored procedure on the database
You'd probably be better off using SMO for this. That easily differentiates the proc header from the body for example. You could even use TSQL100Parser.
Aug
6
comment Is there a way to grant a user access to only all non system views of database?
+1 To me the good thing about this solution over mine is that there is no need to assign permissions explicitly when new views are created.
Aug
1
comment Performance Hit using CAST() in TSQL (SQL Server)?
cast as date can do an index seek but still has problems compared with expressing as a range seek without a cast.
Jul
31
awarded  Enlightened
Jul
31
awarded  Nice Answer
Jul
31
comment Does READ UNCOMMITTED have the same effect as AUTOCOMMIT=1?
Your starting assumption is wrong. Just because transaction T1 runs at read uncommitted doesn't mean that other transactions will see uncommitted changes from T1. It just means T1 sees uncommitted transactions from them...
Jul
31
awarded  Nice Answer
Jul
29
comment What happens during “big” inserts on a table with a clustered composite key?
RE: Will SQL "move" the existing rows to maintain the clustering. No. It will get fragmented and you would need to reorganize/rebuild the index to regain it. Demo of that here
Jul
28
comment Change rowguidcol property to a different column
@wBob - Of course! That makes sense. Unfortunately my hasty DV is locked in unless this answer is edited. But it could do with editing anyway to acknowledge the existence of ALTER TABLE MyTable ALTER COLUMN Col1 DROP ROWGUIDCOL; ALTER TABLE MyTable ALTER COLUMN Col2 ADD ROWGUIDCOL;
Jul
28
comment Change rowguidcol property to a different column
This isn't the case. The ROWGUIDCOL can be removed from/added to columns.
Jul
25
answered Get complete value of varchar(max) field - SQL Server 2005
Jul
24
comment How do I place leading zeros for numbers less than 10 without affecting those 10+?
@user44339 SQL Server doesn't have any such function.
Jul
23
answered Why is my select statement so slow?