I'm trying to get multiple inserts to work in a single script using the SQL Compact 4.0 Toolbox and not having any luck. I keep getting a parsing error.
I've even tried adding GO; between each statement like so..
INSERT INTO ... ;
GO;
INSERT INTO ... ;
with no luck.. so am I out of luck? Do I have to just execute each statement one at a time?
To run a query with multiple statements, ensure that each statement is separated by a semicolon; then set the DSQEC_RUN_MQ global variable to 1 and run the query. When the variable is set to zero, all statements after the first semicolon are ignored.
Microsoft SQL Server Compact 4.0 is a free, embedded database that software developers can use for building ASP.NET websites and Windows desktop applications.
You can either go for f5 it will execute all the scrips on the tab. You can create a sql file and put all the insert statements in it and than give the file path in sql plus and execute. Save this answer.
Update to the latest release version (2.3). There was a bug with multiple statement execution, that has been fixed in the latest release version. Seperate each statement with GO on a separate line, no semicolon after... Like the INSERT statements created by the tool:
INSERT INTO [Shippers] ([Shipper ID],[Company Name]) VALUES (1,N'Speedy Express');
GO
INSERT INTO [Shippers] ([Shipper ID],[Company Name]) VALUES (2,N'United Package');
GO
INSERT INTO [Shippers] ([Shipper ID],[Company Name]) VALUES (3,N'Federal Shipping');
GO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With