Re: Scripting a SQL database
From: Robbe Morris [C# MVP] (info_at_turnkeytools.com)
Date: 02/20/05
- Next message: Paulo Silva Jr: "Re: Cannot create new connection because in manual or distributed transaction mode."
- Previous message: Bob Barrows [MVP]: "Re: Pass parameter to nested query"
- In reply to: Roland Hall: "Re: Scripting a SQL database"
- Next in thread: JTC ^..^: "Re: Scripting a SQL database"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 20 Feb 2005 09:56:18 -0500
Virtually everything SQL Server Enterprise Manager does can be
do via script because that is in large part what EM uses "at some
point" in the process (either directly or indirectly via DMO).
To run the generated script in ASP, you literally just
read the script file in as a string and pass it to the ADO
connection object's .Execute method. It is that simple.
You can also create a DTS (Data Transformation Package)
utilizing the Import / Export Wizard. Then, use ASP to run
the package. This, in my opinion, may be a better option than
scripts from a support and simplicity standpoint. My guess is
that you'll want to select the "copy database objects and data"
when you get to the part in the wizard where it asks you what
you want to do. At the end, you'll be given an option as
to how you want to store the package. Select the option to
store it in SQL Server. What is nice about this option is that
if you make a change to your database, you just rerun the
wizard (after deleting the current package) and you are all set.
No need to move files around or deploy them.
Using the wizard is pretty straight forward. Calling the stored
package in SQL Server isn't. Here is a VBScript (which
is really the underlying language in ASP) to run a DTS
package. It also includes other code for ftp'ing data that
you probably don't need.
http://www.eggheadcafe.com/articles/20030923.asp
I'm upgrading our servers today. So, if the link doesn't come
up, check again in a few hours.
These other SQL Server Flash Video presentations for database
management may also come in handy:
http://www.eggheadcafe.com/videodemo/
-- 2005 Microsoft MVP C# Robbe Morris http://www.robbemorris.com http://www.mastervb.net/home/ng/forumvbcode/post10017013.aspx http://www.eggheadcafe.com/articles/adonet_source_code_generator.asp "Roland Hall" <nobody@nowhere> wrote in message news:e6iVeUzFFHA.2180@TK2MSFTNGP10.phx.gbl... > "Robbe Morris [C# MVP]" <info@turnkeytools.com> wrote in message > news:%23tAuoytFFHA.3840@tk2msftngp13.phx.gbl... > : Yes and yes. > > Thanks for responding... > > I only asked one closed-end question. Can I get some pointers on getting > this done? You might want to review my response to the other responder. > Examples would be great but research material and knowing what to look for > would be fine too. > > : > : You just use the connection.execute mysqlscriptstring > : > : You've just got to connect to the database with an account > : that has enough priviledge to run your script. > > How are the scripts that Enterprise Manager can create from an existing > database used to recreate this structure on a different server? > > Roland > >
- Next message: Paulo Silva Jr: "Re: Cannot create new connection because in manual or distributed transaction mode."
- Previous message: Bob Barrows [MVP]: "Re: Pass parameter to nested query"
- In reply to: Roland Hall: "Re: Scripting a SQL database"
- Next in thread: JTC ^..^: "Re: Scripting a SQL database"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|