SQL Server Blogs

Voices from the UK SQL Server Community
All Tags » tsql (RSS)

Browse by Tags

  • SQL and contiguous data ranges.

    As the saying goes "work smarter, not harder", this is definitely the case for SQL. If you have a poorly performing query, then you are not only affecting that one user but diverting precious machine resources needlessly. This is doubly true if its part of the 20% of code executed 80% of the...
    Posted to SQL and the like (Weblog) by Anonymous on Thu, Aug 27 2009
  • Optimal Query Plans With Unbalanced Data Loads

    Sql Server is great at producing and caching efficient query plans.  However these plans may not be the most efficient based upon the parameters passed into subsequent calls off a stored procedure. In this article I am assuming that you have read both of Erland Sommarskog’s articles The Curse and...
    Posted to SQL and the like (Weblog) by Anonymous on Thu, Aug 27 2009
  • Catch all queries and indexing

    Amongst many others, Gail Shaw has blogged on the subject of catch all queries . On many occasions I have needed to do something similar and found performance to be pretty dire on large tables. Typically I would use dynamic SQL to generate the query but there are occasions where that is not possible...
    Posted to SQL and the like (Weblog) by Anonymous on Thu, Aug 27 2009
  • Another TSQL random length random string generator

    The following function function will return you a random string of the specified characters, for a length of between @StrLenLo and @StrLenHi. The only ‘Oddity’ with using this function is that if the parameters are not dependant upon data within a table SQLServer will create a hash join which will cause...
    Posted to SQL and the like (Weblog) by Anonymous on Thu, Aug 27 2009
  • Enforcing parent child relationship with Path Hierarchy model

    With the classic adjacency model its dead easy to validate that a parent exists, its a bit more difficult with path model. The adjacency model you have a table with a self join you can easily add a foreign key between the two columns. When you store a path the difficulty is that you don't have anything...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Mar 9 2009
  • TSQL Scalar functions are evil.

    I’ve been working with a number of clients recently who all have suffered at the hands of TSQL Scalar functions. Scalar functions were introduced in SQL 2000 as a means to wrap logic so we benefit from code reuse and simplify our queries. Who would be daft enough not to think this was a good idea. I...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Nov 3 2008
  • System function to return just the date and no time

    You will notice a DATE related theme of the posts today. This one is about the lack of a system function that returns JUST the date and DOESNT include any tiem component. Due to time constraints they didn't include such a function, seems like a car without a steerwheel to me, but time is time and...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Tue, Oct 28 2008
  • Set based splitting of delimited strings to columns

    I recently presented on using CLR in SQL at DevWeek and commented on how TSQL Udfs just don't perform. A common scenario people in the audience were using TSQL Udfs for was splitting delimited strings. One guy asked me afterwards what the best way to do it was, he had addresses in one field he wanted...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Mar 17 2008
  • SQL Server 2008 - Whats this abut 30,000 columns?

    Its all about Sparse columns and they are a great feature of Katmai Imagine you have a products table, you will have attributes for some products that don't apply to others i.e. cup size applies to bras but not to socks. There are a number of ways of modelling this each with downsides. With sparse...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Sun, Mar 16 2008
  • TSQL to change collation of database, whats new in SQL 2008 then?

    How can you change collation of a database? How do you check the existing collation setup on a database & tables? By using the below TSQL: --For database select databasepropertyex(db_name(),'collation') as collation_name go --Tables select column_name, collation_name from INFORMATION_SCHEMA.COLUMNS...
Page 3 of 7 (61 items) < Previous 1 2 3 4 5 Next > ... Last »
Powered by Community Server (Commercial Edition), by Telligent Systems