Saturday, September 29, 2007

Migrating SQL 2000 Diagrams to SQL 2005

When copying MDF/LDF files from a SQL 2000 installation to a SQL 2005 installation, diagrams will not open and the solution to getting them to open properly is non-intuitive. Here is T-SQL Code to fix the problem. This is run on the SQL 2005 Server after the MDF has been attached in SQL Management Studio. Substitute your database name where is says "Nexus":

EXEC sp_dbcmptlevel 'Nexus', '90';
go
ALTER AUTHORIZATION ON DATABASE::Nexus TO "sa"
go
use Nexus
go
EXECUTE AS USER = N'dbo' REVERT
go

No comments: