.NETGURU
Running SQL script through windows installer
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.setup.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

BONTZ (VIP)
Hi all,

I have a SQL script(pretty big in size) generated by Enterprise manager.
I need to run that script through VB to install database schema on my
database.
It includes creation of tables, users and stored procedures.

I have written a VB program, which reads the script from a text file and
use Command.executeNonQuery.
I have the program ready, but with problems :

1. If I incluide the SQL script as it is,
It throws exception : Incorrect syntax near 'GO'

2. If I exlude all 'GO's from the script,
It creates the tables and users successfully but throws exception :
Stored Procedures have to be on top in batch query.

3. If I move the procedures to the top, It throws exception at second
porcedure saying : Invalid varable or invalid sytax near procedure .

4. If I move all stored procedures to individual txt files, it works.

Now, as the acript is huge and application is still under development, I
want to work with a single file which i just generate from enterprise
manager.

Is it possible ???

Thnx in advance
Reply to this message...
 
    
Jim Hughes
GO is unique to Query Analyzer. (isqlw.exe, isql.exe, osql.exe)

Another option is to split your script based on \nGO\n and execute it in
more than one batch.

Maybe this article can help?

http://msdn.microsoft.com/msdnmag/issues/04/09/CustomDatabaseInstaller/default.aspx

"BONTZ" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Web.UI.MobileControls.Command




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification