Solved

SQLCE Create Multiple Table Error in query

Posted on 2011-03-13
2
792 Views
Last Modified: 2012-05-11
I have a C# application that connects to a SQL Compact 3.0 database and runs a SQL script which creates multiple tables. However it fails on line 16 which is the following
CREATE TABLE [COMP_SOC](

Open in new window

From this code:
CREATE TABLE [CLAIMOPSSCHED](
	[OFFICER] [nchar] (8) NOT NULL,
	[JOBNO] [int] NOT NULL,
	[ACTDATE] [datetime] NOT NULL,
	[CLAIMACT] [nchar] (6) NOT NULL,
	[DURATION] [int] NOT NULL,
	[NONCHRGFLG] [nchar] (1) NULL,
	[NONFSRFLG] [nchar] (1) NULL,
	[COMMENT] [nchar](100) NULL,
	[USERID] [nchar] (50) NULL,
	[CREATEDON] [datetime] NULL,
	[DISTANCE] [numeric] (10, 2) NULL
);


CREATE TABLE [COMP_SOC](
	[CODE] [nchar] (6) NOT NULL,
	[DESCRIPT] [nchar] (40) NOT NULL
);

Open in new window


The error message i get is:
There was an error parsing the query. [Token line number = 16, Token line offset = 1, Token in error = CREATE]
0
Comment
Question by:AVONFRS
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
AVONFRS earned 0 total points
ID: 35120358
I seem to have resolved this myself. I have just learned that you cannot execute batch queries with SQLCE.
0
 
LVL 1

Author Closing Comment

by:AVONFRS
ID: 35120361
Worked it out myself
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

821 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