Re: How to generate SQL server script programmatically?

From: FLX (nospam_at_hotmail.com)
Date: 06/24/04


Date: Thu, 24 Jun 2004 09:22:30 -0500

Dave,

Thank you very much for the quick response.

I will try the VB solution.

I have two other questions:
1) Do you know any Java solution for this? I can play with VB, but more
comfortable with Java.
2) Can the VB solution deal with the encrypted stored procedures?

Lixin

"Mark Allison" <marka@no.tinned.meat.mvps.org> wrote in message
news:eND9wEfWEHA.2972@TK2MSFTNGP12.phx.gbl...
> Lixin,
>
> There are several solutions to this. Depends on how you want to do it.
> Options are:
>
> 1) T-SQL to generate INSERT statements for your data. see
> http://vyaskn.tripod.com/code.htm#inserts
>
> 2) SQL-DMO to script out a server. See
> http://www.apress.com/book/bookDisplay.html?bID=118 there's a code link
> in there for some VB with SQL-DMO to script out a server. Perhaps you
> can adapt the code there.
>
> 3) Book. http://vyaskn.tripod.com/real_world_sql_dmo_for_sql_server.htm
;-)
>
> I am also aware of a few third party products that can do this, have a
> search on Google.
>
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
>
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
>
>
> FLX wrote:
> > I need prepare an install package for a production SQL Server, which has
> > several databases. The install package basically will consist of scripts
for
> > every objects in the databases, like all the tables, stored procedures,
> > logins, insert statements for the static in the tables, views, User
defined
> > functions, etc. The goal here is to run these scripts so that we can
rebuild
> > the databases on different servers easily.
> >
> > The databases sizes are all very large. It is not practical to make a
backup
> > file and restore, reattach, etc.
> >
> > Is there easy way to do this? I know how to manually generate scripts
using
> > Enterprise Manager. However, I like to find a better and more efficient
way
> > to do it. If I can have or even write a program to do it for me that
will
> > be great. Can anybody show me your "tricks" or point to me a right
> > direction?
> >
> > Thanks a lot,
> > Lixin
> >
> >
> >



Relevant Pages

  • Re: How to generate SQL server script programmatically?
    ... Looking for a SQL Server replication book? ... > I need prepare an install package for a production SQL Server, ... > every objects in the databases, like all the tables, stored procedures, ... The goal here is to run these scripts so that we can rebuild ...
    (microsoft.public.sqlserver.server)
  • Re: How to generate a database or table script in CE
    ... My EBook shows and includes examples of several ways to build SQLCe ... databases including using scripts. ... Hitchhiker's Guide to Visual Studio and SQL Server ...
    (microsoft.public.sqlserver.ce)
  • Re: How to generate SQL server script programmatically?
    ... I'm not aware of a java solution. ... but not through the SQL-DMO API. ... Looking for a SQL Server replication book? ... The install package basically will consist of scripts ...
    (microsoft.public.sqlserver.server)
  • Re: Install Northwind SQL Database?
    ... scripts but I can't open them ... the databases in C:\SQL Server 2000 Sample Databases (or where ever you ... install scripts or attached the databases and get an error? ... It would also be helpful to know what version of SQL Server you're using. ...
    (microsoft.public.sqlserver.setup)
  • Re: Install Northwind SQL Database?
    ... C:\SQL Server 2000 Sample Databases are: ReadMe SQL Sample Db Scripts, ... LogTransaction, SQL Server Database Primary File for Northwind, instPubs SQL ... practice install on a virtual machine. ...
    (microsoft.public.sqlserver.setup)

Quantcast