in

SQL Server Blogs

Voices from the UK SQL Server Community

Browse by Tags

  • User defined function performance is awful, Micorosft please sort this out

    User defined functions looked like something great when they were introduced in SQL 2005. They are a very logical step to make more code reuseable by wrapping common code in functions. It is an approach that is in development 101 and something everyone does and looks to doing. So what is the problem...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Thu, Jan 14 2010
  • 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
  • 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
  • How to get the name of the day of date

    Do you have a date and you want the day of the week but not the number but the name i.e. Monday, Tuesday etc. Well there are two functions that you can use with dates that can be used to extract a part of the date. One function returns the number and one returns text version. The functions are DATEPART...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Sep 3 2007
  • Using SMO from TSQL

    If you are desperate to get your hands on the code I used in the SMO in TSQL demo I did at the usergroup meeting you can download it now from codeplex. http://www.codeplex.com/SMOinTSQL There are 2 projects in there one an SSMS project and one a C# project. Both can be opened using the TFS in codeplex...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Tue, May 8 2007
  • Limit a sql script to only run with SQLCMD turned on

    I really like SQLCMDso much so that most of my deployment scripts use SQLCMD. Its got some great features such as :on error exit. Forcing your script to exit when an error occurs. or :r <filename> to read the contents of a file There is one downside and that is if you run a sqlcmd script in management...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Apr 23 2007
  • How to alert on system errors

    Alerts in SQL server rely on the error being logged to the event log. Not all system messages are logged which means you can't alert on them. In SQL 2000 you could hack the sysmessages table, however in SQL2005 you can't. To get round this in SQL 2005 you can use the try catch block. Catch the...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Wed, Apr 4 2007
  • Developer Day 4 Demo - Now available

    The demo files associated with are now available. Make sure you read the description first as it includes how to deploy the demo. http://sqlblogcasts.com/files/folders/servicebrokerdemos/entry1472.aspx - var height=90;var width=720;
    Posted to Simons SQL Blog (Weblog) by simonsabin on Tue, Dec 5 2006
  • dmvs and CROSS APPLY

    In SQL 2005 there is a new feature by which you can extend a result set with the results of another resultset. You might think thats nothing new because thats exactly what a join is, and with the combination of derived tables you have full control, and you can use table valued functions. However there...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Tue, Nov 28 2006
Page 1 of 2 (20 items) 1 2 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems