Paging in SQL Server 2005
I keep seeing questions on newsgroups about paging in stored procedures, and whether there will be a better way in SQL Server 2005. However, aside from a few answers in newsgroups, I haven't seen any content on how to do it. So I'd like to spend a few minutes and share with you the...
No, stored procedures are NOT bad
I recently found a rather old post from Frans Bouma's blog, "Stored procedures are bad, m'key?".
Since comments are closed (he posted it almost a year ago), I have to reply here.
I'll state my bottom line at the top: Stored procedures are not only not bad, they're necessary for maintaining loosely coupled, application agnostic, flexible...
Pattern-based replacement UDF
As a personal challenge, I decided to write a UDF that will work just like T-SQL's REPLACE() function, but using patterns as input.
The first question: How does REPLACE() handle overlapping patterns?
SELECT REPLACE('babab', 'bab', 'c')
--------------------------------------------------
cab
(1 row(s) affected)
SELECT REPLACE('bababab', 'bab', 'c')
--------------------------------------------------
cac
(1 row(s) affected)
It appears that SQL Server parses the input string from left to right, replacing...
Caveats of the TEXT datatype
Someone named "Krygim" posted the following question today in the microsoft.public.sqlserver.programming newsgroup: "Will defaulting a TEXT field to an empty string take up more space than defaulting it to Null when no data is entered into the field. " Before reading any further, I ask that you think for...