Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 export objects through procedure

Author  Topic 

bj
Starting Member

3 Posts

Posted - 2002-01-02 : 08:54:17
Hi all, I know we can use DTS package to export or import objects from one db to another. Now I need to write a procedure that will perform similar functionality. Any thoughts on this? Thank you!







Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2002-01-02 : 08:57:53
Hi

You can use xp_CmdShell to run DTSRun. A commandline utility for........ running DTS packages.

Books online has the syntax for it all.

Damian

Edited by - Merkin on 01/02/2002 08:58:26
Go to Top of Page

bj
Starting Member

3 Posts

Posted - 2002-01-02 : 11:02:05
HI Merkin,
I looked books on line and came across dtswiz which has /i (import) /x(export) parameters. On the other hand dtsrun does not have these parameters. So I'm sort of confused. What I need to do is import only selected number of tables from db1 to db2.
Thank you!

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-01-03 : 13:53:22
To use dtsrun, first build your DTS package to do exactly what you want accomplished, as if you were doing it all manually. You can build this directly in the DTS designer or you can walk through the DTS wizard and before executing check the option that says "Save DTS Package". Then once your package is created, you can use dtsrun to execute it.

As Merkin mentioned, dtsrun is a command line utility, so if you're going to run it from a SQL stored procedure, you'll need to use xp_cmdshell to call it.

--------------------------------------------------------------
1000 Posts, Here I come! I wonder what my new title will be...
Go to Top of Page
   

- Advertisement -