Link to home
Start Free TrialLog in
Avatar of bequette
bequette

asked on

Running SQL Scripts

We are deploying an application based on MSDE.  I would like to store the database creation and generation details in SQL Script files.  This is an easy solution with SQL Server because I can simply run the scripts from the command line in the installation with the ISQL tool. (Note, I can't use an interactive solution because from the user's standpoint, the database create's itself on install).  The problem is now the solution is based on MSDE, which I am not entirely sure if ISQL (not ISQL/w) is deployed with MSDE.  If it is not, is it redistributable.  If it is not redistributable, does anybody have some good ADO code samples to read an SQL script that uses the same syntax as ISQL.  What I mean by syntax, is support for the "USE <DATABASENAME>" and Go command?
ASKER CERTIFIED SOLUTION
Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of agriggs
agriggs

I am pretty sure that SQL-DMO is installed when you install the SQL Client tools, like ISQL.

I think that you are on the right track when you say you need to read the scripts into an ADO project and then execute them.

GO is not a SQL keyword, it is an ISQL keyword that means just what it says.  So whenever you encounter a GO in your scripts, just execute your SQL string.
You should be able to use the command line version (OSQL) which I think is shipped with MSDE.
bequette:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
I'll register an interest!
Avatar of Anthony Perkins
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Award points to TimCottee

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Anthony
EE Cleanup Volunteer