in

SQL Server Community Blogs

Voices of the SQL Server Community

Browse by Tags

  • 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...
  • 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...
  • 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...
  • 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...
  • 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 error...
  • 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 if (socialButtons!=null) { socialButtons(); } - google_ad_client = "pub-9351707026400773"; google_alternate_color...
  • 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...
  • Referencing Parent nodes in XQuery is expensive

    Recently a post on a newsgroup caught my attention. "OPENXML vs XQuery Performance", it caught my attention because I did a bucket load of performance testing of OPENXML way back when for SQL Server 2000 XML Distilled and hadn't touched XQuery really. What the poster found was that OPENXML was faster...
  • CREATE or REPLACE feature request

    I remember back when I moved from Oracle to 6.5 I found the lack of a create or replace really annoying. Whenever I create new sps I always curse at not being able to do "create or replace myproc..." having to do "if exists (select 1 information_schema...)" or "if object_id(...) is not null" or "if not...
  • TSQL turning into C#

    Following my previous post about the requirement of semi-colons when using service broker statements, I have raised a suggestion to improve the "Incorrect syntax near ..." error message. If you find the above message less than helpful, then vote for the suggestion. https://connect.microsoft.com/SQLServer...
Page 1 of 2 (17 items) 1 2 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems