Help with create database script
Hello everybody. Does anyone know how to do a script like CREATE DATABASE myDatabase; that will create a version 9 compatible database(2005)? I'm using Microsoft SQL Server 2008 Developer. I will be using scripts as much as I can for documentation purposes so will avoid using the UI whenever possible.
Re: Help with create database script
I doubt about from Higher version to lower version compatibility!
Re: Help with create database script
Hey everybody. After an SQL Server database is created you can change the compatibility from 2008 to 2005 in script with the following code:
ALTER DATABASE myDatabase
SET SINGLE_USER
GO
EXEC sp_dbcmptlevel myDatabase, 90;
GO
ALTER DATABASE myDatabase
SET MULTI_USER
GO
In case anyone needs the information :)