Friday, December 20, 2013

Deprecated SQL Server 2008 commands

Run a lot of your normal commands within your new SQL Server v2012 instances, and you're going to see a lot of this:

                    Msg 2812, Level 16, State 62, Line 1
                    Could not find stored procedure ' xxxxxxxx '.

This is simply due to the code deprecations... that we should have read about ahead of time.   :-) 
There are many different deprecations, but these are a few examples of sp_dboption, old and new:

  OLD:  
      EXEC sp_dboption dbname, 'auto create statistics', true
      EXEC sp_dboption dbname, 'auto update statistics', true
      EXEC sp_dboption dbname, 'read only', true

  NEW:
      ALTER DATABASE dbname SET AUTO_CREATE_STATISTICS ON
      ALTER DATABASE dbname SET AUTO_UPDATE_STATISTICS ON
      ALTER DATABASE dbname SET READ_ONLY

This is a much more detailed reference of the SQL Server 2008 deprecations from Microsoft:
     http://msdn.microsoft.com/en-us/library/ms143729(v=sql.100).aspx

No comments:

Post a Comment