How to install database using SQL script from .net deployment project in VS

N

Nitin Singh

We are using a VS Deployment Project to distribute an ASP.NET app.
Presently we take script files to client and run them in Query Analyser of
SQL Server. But we want to automate running of SQL scripts along with the
application installer.

We tried using a project which reads script files and run them by passing it
to SQL Client's Command object, but this accepts only ONE entity's script at
a time.

So in order to create about 100 tables and 500 sp, we require writing 600
calls to the function which sends the script to command object.

If we create the script for all objects in a single file, the "GO" keyword
throws and error.

Please help me.


Nitin Singh
ASP.NET Developer

India
 
J

Jamie Bissett

Nitin Singh said:
We are using a VS Deployment Project to distribute an ASP.NET app.
Presently we take script files to client and run them in Query Analyser of
SQL Server. But we want to automate running of SQL scripts along with the
application installer.

We tried using a project which reads script files and run them by passing
it
to SQL Client's Command object, but this accepts only ONE entity's script
at
a time.

So in order to create about 100 tables and 500 sp, we require writing 600
calls to the function which sends the script to command object.

If we create the script for all objects in a single file, the "GO" keyword
throws and error.

Please help me.


Nitin Singh
ASP.NET Developer

India
Check out this URL
http://www.codeguru.com/Csharp/.NET/net_security/encryption/article.php/c9601/
 
N

Nitin Singh

Thanks

the problem has been solved, by using the "regex " in the ExecuteSQL
function.

Nitin Singh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,054
Latest member
LucyCarper

Latest Threads

Top