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)
 DTS for file copy job

Author  Topic 

tiggyboo
Starting Member

5 Posts

Posted - 2007-11-02 : 13:10:43
Hi, I'm pretty new to DTS, at least as far as any real complexity goes. I just need a jumpstart in the form of a skeleton script or pseudo-code on how to handle the following - based on queries to the database, on a row by row basis, filenames are composed then a file copy/rename needs to be executed to a a fileshare on a remote server. Coudl this be accomplished entirely within DTS or am I better off just having DTS write a file that consists of a bunch of copy commands, then execute the file externally?
Thanks,
Al

anonymous1
Posting Yak Master

185 Posts

Posted - 2007-11-02 : 13:24:14
in DTS you can iterate over files based on a query, but the solutions i am familiar with are not pretty. is SSIS from SQL 2005 an option for you?
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-02 : 23:28:58
You can do that using sp, run dos command with xp_cmdshell in the sp.
Go to Top of Page

tiggyboo
Starting Member

5 Posts

Posted - 2007-11-05 : 15:18:05
quote:
Originally posted by rmiao

You can do that using sp, run dos command with xp_cmdshell in the sp.



Thanks, this seems promising. However, the files to be manipulated are on a remote host (within our LAN) and attempts by SQL Server to run xp_cmdshell against it are being denied since it is interpreted as an anonymous login attempt. Any idea how to apply credentials to the server for purposes of xp_cmdshell?
Thanks a bunch,
Al
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-05 : 22:34:36
Start sql service with domain account.
Go to Top of Page

tiggyboo
Starting Member

5 Posts

Posted - 2007-11-06 : 16:50:40
quote:
Originally posted by rmiao

Start sql service with domain account.


The MSSQLSE service or SQLSERVEAGENT service? The gui for this editor is driving my workstation nuts, by the way, hopefully this is readable :-)
Al
Go to Top of Page

tiggyboo
Starting Member

5 Posts

Posted - 2007-11-06 : 17:40:42
quote:
Originally posted by anonymous1

in DTS you can iterate over files based on a query, but the solutions i am familiar with are not pretty. is SSIS from SQL 2005 an option for you?


Meant to thank you for your response. That's a new concept to me, I'll check it out!
Thanks,
Al
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-06 : 23:02:41
>> The MSSQLSE service or SQLSERVEAGENT service?

both
Go to Top of Page
   

- Advertisement -