THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » T-SQL   (RSS)
Showing page 24 of 25 (242 total posts)
  • Dealing with very large bitmasks

    Continuing in my series of things you should probably not do in SQL Server but sometimes have to, I'm going to do a few posts on dealing with very large bitmasks. Let me first state my utter hatered of bitmasks in databases. I think they're annoying, make the system difficult to understand, and whether or not they violate the First Normal ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Validate a URL from SQL Server

    File this one in your folder of things you should probably never use -- but maybe, some day, in an emergency, you'll need this. I see posts requesting this functionality all the time. ''How do I validate a URL in SQL Server?'' Not just the string, but the URL itself -- how can we find out if it's valid? Thanks to the Object Automation ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Counting occurrences of a substring within a string

    I have absolutely no idea why anyone wants to do this, but I keep answering the same question in forums: ''How do I count the occurrences of a substring [note: usually comma] within a string?''   In an effort to thwart carpal tunnel syndrome, I have created the Ultimate Substring Occurrence Counting UDF. ... And here it ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Splitting a string of unlimited length

    There are many techniques for splitting a string in T-SQL (in other words, taking a character-delimited string and producing a table of the values), the best of which are encapsulated in Erland Sommarskog's famous article. My favorite of his string splitting techniques is adapted from a previous example that was created by Anith Sen. Both ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Controlling Stored Procedure Caching with ... Dyanmic SQL?!?

    Tell me if this situation sends a chill down your spine: You've written a stored procedure, tested it against a variety of inputs, and finally rolled it out in production. All is well... Or so you think. You start getting complaints from some users that it's taking forever to return. But other users are having no problem. What ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • You REQUIRE a Numbers table!

    Looking at my list of upcoming articles, I keep seeing the same theme repeated over and over. A sequence table of Numbers.   Numbers tables are truly invaluable. I use them all of the time for string manipulation, simulating window functions, populating test tables with lots of data, eliminating cursor logic, and many other tasks that ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Performance: ISNULL vs. COALESCE

    Mladen aka spirit1 posted a speed test of COALESCE vs. ISNULL. Reported result: COALESCE is faster. But leave it to Anatoly Lubarsky to argue with what was posted. He posted his own speed test, showing that ISNULL is faster. Anatoly's results showed a miniscule difference, ''52 seconds'' vs. ''52-53 seconds''. Mlanden's tests show a ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Rowset string concatenation: Which method is best?

    Yeah, yeah, yeah, let's get this out of the way right from the start: Don't concatenate rows into delimited strings in SQL Server. Do it client side. Except if you really have to create delimited strings in SQL Server. In which case you should read on. There was a little discussion on SQLTeam about the best way to concatenate. I ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • Is PATINDEX faster than LIKE?

    I keep seeing the same suggestion on various ''tips and tricks'' websites: For situations in which you might want to use LIKE in the WHERE clause, but for which indexes cannot be used, PATINDEX will perform faster.   So, according to these sources, this:  SELECT *FROM tblWHERE PATINDEX('%abc%', col) > 0 is faster than ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
  • 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 new features that will make paging stored procedures ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on July 12, 2006
Privacy Statement