If you are re-attaching databases after a SQL 2008 upgrade, here is a quick n dirty T-SQL command to upgrade to the the correct compatibility level, just run, copy the results and run those:


select 'ALTER DATABASE [' + [name] + '] SET COMPATIBILITY_LEVEL = 100'
from master.dbo.sysdatabases

  • Share/Bookmark

Related posts:

  1. SQL Tip: Running a large script from command line
  2. SQL Server DBA Harvests: Permissions
  3. SQL 2008: Querying query plans
  4. SQL: Change a datatype updating all PKs and FKs
  5. SQL Server: Sorting job steps

Tags: , ,

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>