Solved

T-SQL Error using SSMS 2012

Posted on 2014-02-07
1
375 Views
Last Modified: 2014-02-07
I am trying to run the T-SQL below in SSMS and I am getting an error on the CONTAINS keyword.  IS there an option in SSMS that I am missing to be able to run all T-SQL commands?  

CREATE DATABASE Documents ON PRIMARY (    NAME = N'Documents',    FILENAME = N'C:\SQL2012\Documents.mdf' ), FILEGROUPFSGROUP CONTAINS FILESTREAM (    NAME = FSData,    FILENAME= 'C:\SQL2012\FSDataStore.ndf' ) LOG ON (    NAME = N'Documents_Log',    FILENAME = N'C:\SQL2012\Documents_log.ldf' ) WITH FILESTREAM (    NON_TRANSACTED_ACCESS = FULL,    DIRECTORY_NAME = N'Documents' )

Open in new window


Msg 156, Level 15, State 1, Line 4
Incorrect syntax near the keyword 'CONTAINS'.
Msg 319, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
Msg 156, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'CONTAINS'.
Msg 319, Level 15, State 1, Line 8
Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
0
Comment
Question by:hojohappy
1 Comment
 
LVL 21

Accepted Solution

by:
Dale Burrell earned 500 total points
ID: 39843615
Looks to me like you are missing a space i.e.

FILEGROUPFSGROUP CONTAINS FILESTREAM

should actually be

FILEGROUP FSGROUP CONTAINS FILESTREAM
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now