January 12, 2012 at 5:38 am
Hello
I am taking my SQL exam and trying to practise creating a database I have done the code below but i get an error as below:
create database tk432 on primary
( name = N'tk432_data',filename = N'c:\test\tk432.mdf', size = 8MB, maxsize = unlimited, filegrowth = 16MB ),
filegroup fg1
( name = N'tk432_data2',filename = N'c:\test\tk432.ndf', size = 8MB, maxsize = unlimited, filegrowth = 16MB),
FILEGROUP Documents CONTAINS filestream default
( name = N'Documents',filename = N'c:\test\tk432Documents' )
log on
( name = N'tk432_log', filename = N'c:\test\tk432.ldf', size = 8MB, maxsize = 2048GB, filegrowth = 16MB)
go
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'CONTAINS'
can anyone help?
January 12, 2012 at 6:01 am
Can't see anything wrong with it. Make sure you are running this on SQL 2008?!? Also make sure Filestream is enabled for the installation and server properties.
January 12, 2012 at 7:08 am
agh see I am running it on 2005 which doesnt work with filestream that is why this wont be working I am guessing?
How would I go about checking what you have suggested in the last sentence?
January 12, 2012 at 7:10 am
http://msdn.microsoft.com/en-us/library/cc645923.aspx
January 12, 2012 at 7:15 am
You should use following syntax for Create Database statement in SS2K5.
CREATE DATABASE database_name
[ ON
[ PRIMARY ] [ <filespec> [ ,...n ]
[ , <filegroup> [ ,...n ] ]
[ LOG ON { <filespec> [ ,...n ] } ]
]
[ COLLATE collation_name ]
[ WITH <external_access_option> ]
]
[;]
For More: http://msdn.microsoft.com/en-us/library/ms176061(v=SQL.90).aspx
January 12, 2012 at 7:17 am
thanks everyone that has been very helpful
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply