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)
 copying files

Author  Topic 

cognos79
Posting Yak Master

241 Posts

Posted - 2006-10-10 : 17:26:35
can anybody tell how can i copy files from one directory to another using SQL Server DTS.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-10 : 17:47:49
You can do this via an ActiveX script.

Tara Kizer
Go to Top of Page

cognos79
Posting Yak Master

241 Posts

Posted - 2006-10-11 : 00:12:18
Tara...can you post sample code how to do this. I am new to using DTS.
Thanks.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-11 : 00:57:55
ActiveX is just VBScript. You create an ActiveX task in your DTS package then have code in the task that does what you want. For VBScript help, check this out:
http://www.devguru.com/Technologies/vbscript/quickref/vbscript_intro.html

Tara Kizer
Go to Top of Page

cognos79
Posting Yak Master

241 Posts

Posted - 2006-10-11 : 11:09:21
thanks Tara for ur suggestion.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2006-10-11 : 13:10:42
please don't use DTS for this.

You can do this using master..xp_cmdshell



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-10-11 : 13:32:33
I'd actually prefer DTS for this as xp_cmdshell requires sysadmin which should only be used for DBA type purposes.

Tara Kizer
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-10-11 : 22:52:17
if this is scheduled, just create a bat file and schedule it using windows task scheduler

I prefer not to depend too much on sql server to isolate processes that don't really need sql server usage

--------------------
keeping it simple...
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-10-11 : 23:07:05
You can use VB Script, DTS ActiveX, or sp_OA stored procedures to copy the file using the file system object.





CODO ERGO SUM
Go to Top of Page

cognos79
Posting Yak Master

241 Posts

Posted - 2006-10-12 : 09:56:37
There is already a DTS Package created and so I was asked to create this process as part of the DTS package.
Go to Top of Page
   

- Advertisement -