I have used the "Generate Scripts" wizard/thingy to create a script to create a database (Meterbilling), build the tables etc.
To run this from .net using SqlCoomand.ExecuteNonQuery I know I have to edit it and replace all the 'GO' commands with semicolon.
But I still get an error. After the Create database (and the Alter Database statements that follow it, there is a USE [Meterbilling] " statement.
This gives an error that the database does not exist. And it doesn't exist either, if I look afterwards.
If I truncate the file just before this, the database is created without error.
Do I need some kind of Execute Statement before the USE statement? 'GO' just gives a syntax error.
Thanks
David Gordon-Brown