in

SQL Server Blogs

Voices from the UK SQL Server Community

Browse by Tags

  • Performance Tuning and Query Optimisation–SQLBits Training Day

    I will be doing a training day at SQLbits in April on Performance Tuning and Query Optimisation. This is the outline for the day. Its going to be an intense day, I look forward to seeing you there. To register go to http://www. sqlbits .com/information/registration.aspx . Places are limited so make sure...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Sat, Jan 29 2011
  • What line does the error line number refer to?

    You’ve got an error and it gives you a line number Msg 50000, Level 16, State 1, Procedure TestToSeeWhatTheErrorLineNumberRefersTo, Line 14 Some Error What line does that actually refer to? Well its the line in the original batch that compiled the procedure and so in the case below it includes the comments...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Thu, Jul 15 2010
  • Avoid SQL Injection with Parameters

    The best way to avoid SQL Injection is with parameters. With parameters you can’t get SQL Injection. You only get SQL Injection where you are building a SQL statement by concatenating your parameter values in with your SQL statement. Annoyingly many TSQL statements don’t take parameters, CREATE DATABASE...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Apr 5 2010
  • Accessing system views in global stored procedures

    Having utility functions that do helpful stuff is great, just look at sp_who2, sp_help, sp_helpindex as examples. What if you want to write your own. Well you can you just stick the procedure in master and prefix it with sp. You can now call the procedure from any database without calling master..procedure...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Wed, Feb 24 2010
  • 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
  • TSQL Challenge - Remove duplicates from a string

    I have a table where a coloumn contains the ordering of some preferences. Each preference is represented by a letter ,i.e. AYFT represents preferences A, Y, F and T in that order. All 26 characters are possible preferences. A preference can only appear once in the string. Due to a bug the data has become...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Tue, Jan 5 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
  • 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
Page 1 of 3 (24 items) 1 2 3 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems