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

Tech-Archive recommends: Fix windows errors by optimizing your registry



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


.



Relevant Pages

  • Re: Vista hosting XPe tools/db
    ... Are you running this script on the machine that actually has the SQL server ... machine hosting the database. ... i don't know if you can install a second instance of SQL ...
    (microsoft.public.windowsxp.embedded)
  • Re: ActiveX script works in DTS but not in job, why?
    ... Account that SQL Agent runs under and it is a Local Admin on the box. ... As another test I saved the script as a .vbs file and tried running it, ... Microsoft OLE DB Provider for SQL Server ... that would be since I need to be able to load DTS packages from either a SQL ...
    (microsoft.public.sqlserver.dts)
  • Re: Enterprise Manager Newbie Question
    ... a SQL backup is not a simple copy of the database files. ... Is it possible to write a script that one could run from a workstation and ...
    (microsoft.public.sqlserver.tools)
  • Re: Vista hosting XPe tools/db
    ... here's an alternative script using the Microsoft ADO as ... opposed to the SQL DMO - this should allow this script to work ... Microsoft Windows XP Embedded Test Team ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.windowsxp.embedded)
  • Re: SQL Security
    ... except I'm having problems making it work in a script. ... ;Set properties of DB objects and open connection to database ... > from Books Online (within the SQL Server program group): ... > communicate with SQL Server. ...
    (microsoft.public.sqlserver.server)