Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. I learn something new everyday

I learn something new everyday

Scheduled Pinned Locked Moved Clever Code
databasecsharpperformancehelpsharepoint
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ennis Ray Lynch Jr
    wrote on last edited by
    #1

    SQL Server 2005 was behaving quirky. My dev box was executing a particular user defined stored procedure relatively fast and the test and prod servers where timing out. Manually executing the query from Enterprise manager yielded instant results from all three environments so I assumed it must be a code issue. Stepping the code with a stop watch everything is instant until the execute on the command. Great, WTF can it possibly be? The code and DB on are the same machine so it isn't a transport problem even though the parameters are quite large. Searching on the web revealed the answers. (The relevant portion of the sp is using XML parameters and on-the-fly indexes on an in memory table) It seems that when using indexes on views the ARITHABORT must be ON! Not doing so is a crippling difference. To make matters worse ARITHABORT is default on with ANSI_WARNINGS ON and compatibility set to 90 or higher. Otherwise it must be manually set. I added SET ARITHABORT ON; to the top of my procedure and now the whole thing runs like lightening. http://aspadvice.com/blogs/ssmith/archive/2008/02/15/Stored-Procedure-Performance-Varies-Between-ADO.NET-and-Management-Studio.aspx[^] http://msdn.microsoft.com/en-us/library/ms188783.aspx[^]

    Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
    Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
    Most of this sig is for Google, not ego.

    P 1 Reply Last reply
    0
    • E Ennis Ray Lynch Jr

      SQL Server 2005 was behaving quirky. My dev box was executing a particular user defined stored procedure relatively fast and the test and prod servers where timing out. Manually executing the query from Enterprise manager yielded instant results from all three environments so I assumed it must be a code issue. Stepping the code with a stop watch everything is instant until the execute on the command. Great, WTF can it possibly be? The code and DB on are the same machine so it isn't a transport problem even though the parameters are quite large. Searching on the web revealed the answers. (The relevant portion of the sp is using XML parameters and on-the-fly indexes on an in memory table) It seems that when using indexes on views the ARITHABORT must be ON! Not doing so is a crippling difference. To make matters worse ARITHABORT is default on with ANSI_WARNINGS ON and compatibility set to 90 or higher. Otherwise it must be manually set. I added SET ARITHABORT ON; to the top of my procedure and now the whole thing runs like lightening. http://aspadvice.com/blogs/ssmith/archive/2008/02/15/Stored-Procedure-Performance-Varies-Between-ADO.NET-and-Management-Studio.aspx[^] http://msdn.microsoft.com/en-us/library/ms188783.aspx[^]

      Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
      Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
      Most of this sig is for Google, not ego.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      I wonder if this applies to SQL Server 2008 as well.

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups