Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
stahorse
Yak Posting Veteran
86 Posts |
Posted - 2013-10-22 : 04:33:27
|
I have this script for creating DB and ALTER it that gives me errors:Script:CREATE DATABASE [SQLDevTest] --CONTAINMENT = NONE ON PRIMARY ( NAME = N'SQLDevTest', FILENAME = N'C:\Databases\SQLDevTest.mdf' , SIZE = 361472KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'SQLDevTest_log', FILENAME = N'C:\Databases\SQLDevTest.ldf' , SIZE = 9216KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)GOALTER DATABASE [SQLDevTest] SET COMPATIBILITY_LEVEL = 100GOALTER DATABASE [SQLDevTest] SET HONOR_BROKER_PRIORITY OFF GOERRORS:1. Directory lookup for the file "C:\Databases\SQLDevTest.mdf" failed with the operating system error 2(error not found).Msg 1802, Level 16, State 1, Line 1CREATE DATABASE failed. Some file names listed could not be created. Check related errors.2. Incorrect syntax near '100'3. Incorrect syntax near 'HONOR_BROKER_PRIORITY'. |
|
sz1
Aged Yak Warrior
555 Posts |
|
stahorse
Yak Posting Veteran
86 Posts |
Posted - 2013-10-22 : 09:27:23
|
I am using 2012 but I'm still getting the same error |
|
|
sz1
Aged Yak Warrior
555 Posts |
Posted - 2013-10-22 : 09:50:17
|
You may be using the latest 2012 version of SSMS but what db version are you connecting to? it may be 2005, its the db itself that needs to be version 2008, 2012.I get the same error when trying to run the code on a 2005 db server but its fine on one of my 2012 servers.Can you double check the db source is in actual fact a 2012 db?SZ1Please help me to enable me to help others! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-22 : 10:09:55
|
try this and post back resultSELECT @@VERSIONGOEXEC sp_dbcmptlevel 'Your database name'GO ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|
|
|