Reputation
39,284
Next tag badge:
572/400 score
77/80 answers
Badges
8 104 163
Newest
 Enlightened
Impact
~1.6m people reached

7h
comment T-SQL : Is string a Palindrome?
@IsmaelMiguel that isn't valid TSQL. SQL server doesn't allow you to return a Boolean datatype. You could make it shorter with SELECT IIF(@string = REVERSE(@String),1,0) AS Palindrome; though.
1d
revised Trim Trailing Whitespace, Tab, Newline, Carriage Returns, etc
Added USP to answer
1d
comment T-SQL : Is string a Palindrome?
@MSIS - It's basically the same algorithm as you describe in the question but done in a set based way rather than iterative procedural code.
1d
revised T-SQL : Is string a Palindrome?
deleted 40 characters in body
1d
revised T-SQL : Is string a Palindrome?
added 244 characters in body
1d
answered T-SQL : Is string a Palindrome?
1d
comment Can we commit the transaction when the sql server trigger fails?
Quite likely. I did focus in on that point as it is potentially extremely dangerous.
1d
comment Trim Trailing Whitespace, Tab, Newline, Carriage Returns, etc
@srutzky - Thanks. I've updated the collation I'll leave fixing the specific white space characters as an exercise to the reader.
1d
revised Trim Trailing Whitespace, Tab, Newline, Carriage Returns, etc
added 5 characters in body
1d
comment Can we commit the transaction when the sql server trigger fails?
@PushCode you should heed the warning and not use this approach even though technically it is possible to commit in a trigger. People will legitimately expect that if they issue an explicit begin tran before the insert nothing is going to be committed unless they do so.
2d
comment Do temporal tables log changes when there are none?
For regular tables check the information here by @PaulWhite sqlblog.com/blogs/paul_white/archive/2010/08/11/…. I haven't looked into temporal tables yet. Is there any reason to expect they will behave differently?
2d
comment Can the OUTPUT clause create a table?
There's always the OPENROWSET hack...
2d
revised Slow-running query returns incomplete resultset
added 298 characters in body
2d
revised How can a database parameter be used on `sp_addextendedproperty`?
deleted 78 characters in body
2d
comment List of queries run
"I'm looking for a DMV query for SQL Server 2008 R2 which shows me all queries (full history) run by a specific user." - This doesn't exist out the box. You would need to use tracing, extended events or SQL Audit.
2d
revised Should we still be using QUOTENAME to protect from injection attacks?
added 248 characters in body
2d
comment Slow-running query returns incomplete resultset
The execution plan shows instances of the same tables being accessed repeatedly. (E.g. tblUnitDetail, tblReportDetail and tblReportDaily) quite likely these could be consolidated if you rewrite without the views.
2d
revised Why database snapshot creation is faster than normal database backups?
added 379 characters in body
2d
comment Query against sys.schemas and sys.synonyms runs very slow for one user
@GeoffPatterson - I didn't claim it was negligible, but it would need a lot more calls before I got up to the 3-6 minutes experienced by the OP so it would be interesting to know how many objects they actually have.
2d
revised Why are numbers tables “invaluable”?
deleted 1 character in body