in

SQL Server Blogs

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

Browse by Tags

  • SQL Server 2008 - Converting binary(hex) values to strings

    One of the frequently asked questions in the newsgroups is how do you convert a string representation of a binary value to the equivalent binary value and the reverse. The latter is often required to be able to print out the binary representation. There have been a few undocumented functions and many...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Tue, Mar 11 2008
  • SQL Server scrollable server cursors, use them carefully!

    One sentence, if you haven't used the Cursors sensibly then database performance will be cursed! This is for newbie users and DBAs to be aware that on general recommendation is server side cursors are better than client side one, in this you need to be careful using the scrollable API server cursor methods...
  • SQL Server 2008 - ISDATE doesn't work with

    I really don't understand this. The ISDATE function doesn't work with new date and time types, whats more you can't pass it a string representing a date before 1/1/1753. Try this select ISDATE('1/1/1700') in SQL 2008 it will return 0. Whats odd is that there is no function to cater...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Wed, Mar 5 2008
  • The problem with local variables

    Have you ever been writing a query and just cannot get it to use the right index? This could be one of the reasons why. Let's use this query with local variables as our example. declare @Start datetime declare @End datetime select @Start = '2004-08-01 00:00:00.000' select @End = '2004-07-28 00:00:00...
    Posted to Jason Massie's SQL blog (Weblog) by JasonMassie on Fri, Jan 25 2008
  • SQL Server 2008 Plan Guides from Cache

    Uhoh... I can see some junior developers going crazy with this. One of the things that kept plan guides from being over used was the fact that they are kind of hard :) Well, Microsoft built their empire making hard stuff easy. They do it again with sp_create_plan_guide_from_cache. Let's look at this...
    Posted to Jason Massie's SQL blog (Weblog) by JasonMassie on Fri, Jan 18 2008
  • SQL Server 2008 - Batch inserts and identity columns using MERGE

    Performing bulk inserts into a table when the table has an identity column has long bee a difficult challenge for client programming. The difficulty has been getting the identity values that have been generated for the set of data you are saving. It becomes even more difficult when you want to save parent...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Mon, Dec 31 2007
  • Katmai Spatial - First thoughts

    I've been doing some work with the Spatial types in Katmai and these are my first thoughts. The first thing is that the data type is the same used by SQL as used in your .Net code. So what does that mean, · You use the same methods, which is great from a familiarity perspective · When calling the...
    Posted to Simons SQL Blog (Weblog) by simonsabin on Sun, Dec 9 2007
  • A quick and dirty WTF???!!!11one

    You can use this to get a quick and dirty picture of what is going on with the server. We basically grab a snapshot, wait a second and then get a diff. Sort as needed. select r . cpu_time , r . logical_reads , r . session_id into #temp from sys.dm_exec_requests as r waitfor delay '00:00:01' select substring...
    Posted to Jason Massie's SQL blog (Weblog) by JasonMassie on Fri, Dec 7 2007
  • Accessing OS performance counters from tsql

    A cool use of WMI data from within SQL that I have found is getting to OS perfmon data. There are several ways of doing it. I would say the best practice would be CLR if you need it in real time or SSIS if you are logging to a table for reporting purposes. You can also hit it through xp_cmdshell and...
    Posted to Jason Massie's SQL blog (Weblog) by JasonMassie on Fri, Nov 30 2007
  • 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
Page 4 of 7 (61 items) « First ... < Previous 2 3 4 5 6 Next > ... Last »
Powered by Community Server (Commercial Edition), by Telligent Systems