April 23, 2008 at 11:30 am
Hi All
I have a server that produces a text file, with a random file name, i am using SQL 2000, i need to load all the files into tables, i can use DTS, but i dont know how to pick up the file from that remote server folder, and i cant delete the files once its loaded as well, i can change the location of the file, have any one done something like this??, is there any other way to load data??
Cheers
Suji
April 23, 2008 at 12:37 pm
you can use xp_cmdshell to issue a DIR command into a table and then interrogate to suit.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
April 23, 2008 at 1:10 pm
copy the file from remote server by using xp_cmdshell.Use DTS to export this file to the table.after loading delete the file
April 24, 2008 at 3:30 am
Thanks a lot Guys
this sounds perfect, i will try this
Cheers
Suji
April 25, 2008 at 2:55 am
Another option would be to include an ActiveX task in your DTS and use the FileSystemObject to interrogate the remote directory and do any file moving you require.
April 25, 2008 at 3:15 am
Or just write a small VB script...
April 25, 2008 at 6:11 am
you can use bulk insert option & xp_cmdshell which is faster
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply