THE SQL Server Blog Spot on the Web

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

Browse by Tags

All Tags » TSQL   (RSS)
Showing page 2 of 2 (18 total posts)
  • Be careful with constraints calling UDFs

    You might just not get what you think. I would be surprised if this hasn't been blogged already, but if so, it would be worth repeating. Here's the deal (example from a forum,, slightly re-worked): I want the values in one column to be unique, assuming the value in another column is 1. Can I use an UDF for that? On the surface, yes. You can ...
    Posted to Tibor Karaszi (Weblog) by TiborKaraszi on December 17, 2009
  • Cleaning up Un-Named Defaults

    I just had a situation in which we are automating the comparing of databases and I came across a bunch of Defaults that were never explicitly named. This causes them to get a new name each time you create them and makes it much more difficult to write future update scripts when you don’t know the actual name it will be. In any case I decided to ...
    Posted to Andrew Kelly (Weblog) by Andrew Kelly on June 26, 2009
  • My datetime article updated for 2008

    Actually, the article has been out for about a month now, but I first solicited feedback on errors and typo's and then I forgot to mention the update here... Anyhow, the article now also covers 2008 and the new date, time, datetime2 and datetimeoffset types. There are some interesting aspects of the new types which sets them apart from the old ...
    Posted to Tibor Karaszi (Weblog) by TiborKaraszi on September 23, 2008
  • When a Function is indeed a Constant

    In my last blog post: I mentioned that I ran across a situation in which GETDATE() used in a SELECT statement occasionally returned more than 1 value for the result set. That sparked quite a debate amongst SQL Server programmers who belonged to ...
    Posted to Andrew Kelly (Weblog) by Andrew Kelly on March 1, 2008
  • When GETDATE() is not a constant

    A short while ago I was collecting wait stat information at a client and ran across a very peculiar situation that I would like to share. Let me start by saying that for years I have coded with the understanding that when you include a system function in the SELECT list of a TSQL statement the function was evaluated once at the beginning and that ...
    Posted to Andrew Kelly (Weblog) by Andrew Kelly on February 27, 2008
  • Non-trusted constraints

    A discussion in the newsgroups before the holidays lead to trusted constraints and performance. This inspired me to blog about it, but I decided to have some vacation first :-). Instead of having one long article, I'll do a two-part. This one is about non-trusted constraints in general, and another one will follow about non-trusted constraints and ...
    Posted to Tibor Karaszi (Weblog) by TiborKaraszi on January 12, 2008
  • Sorted views...

    Here's one that pops up regurarly. Something like: ''My views are no longer ordered in SQL Server 2005. I have ORDER BY in the view, but when I select from it, the rows are not returned according to the ORDER BY.'' Since I tend to post a reply often enough to above type of posts, I decided to put it in writing once and for all, so I can point to ...
    Posted to Tibor Karaszi (Weblog) by TiborKaraszi on November 28, 2007
  • Is 'YYYY-MM-DD' always treated as year, month, date?

    Most of you already know the answer to this question: no. I won't recap the rules for interpretation of the current datetime literals, as I have an article on the subject: However, SQL Server 2008 introduces a number of new date, datetime and time datatypes. One interesting aspect of these is ...
    Posted to Tibor Karaszi (Weblog) by TiborKaraszi on August 4, 2007
Privacy Statement