in

SQL Server Blogs

Voices from the UK SQL Server Community

Browse by Tags

  • 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
  • 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
Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems