Jul 19, 2004 #1 balistikb Technical User Nov 12, 2002 177 US Is it possible to change a .dat file to a .txt file in a dts? I tried but it doesn't recognise .dat.
Jul 19, 2004 #2 JayKusch MIS Oct 30, 2001 3,199 US If you are just trying to change the name of an existing .dat file to a .txt file, you could use the xp_CmdShell option as in ... EXEC xp_CmdShell 'Ren C:\Myfile.dat C:\Myfile.txt' Thanks J. Kusch Upvote 0 Downvote
If you are just trying to change the name of an existing .dat file to a .txt file, you could use the xp_CmdShell option as in ... EXEC xp_CmdShell 'Ren C:\Myfile.dat C:\Myfile.txt' Thanks J. Kusch
Jul 19, 2004 Thread starter #3 balistikb Technical User Nov 12, 2002 177 US Can you explain what that command is doing? Break it down so I can understand. Thanks, I am new to this. Upvote 0 Downvote
Can you explain what that command is doing? Break it down so I can understand. Thanks, I am new to this.
Jul 19, 2004 #4 JayKusch MIS Oct 30, 2001 3,199 US It is shelling out to DOS and running a RENAME command on your file. It is changing it from a .DAT to a .TXT Full command should be ... EXEC master..xp_CmdShell 'Ren C:\Myfile.dat C:\Myfile.txt' You would of course change the Path and file name to correspond to your file name. Wrap this in a "Execute SQL Task" object w/in your DTS package and you are good to go! Thanks J. Kusch Upvote 0 Downvote
It is shelling out to DOS and running a RENAME command on your file. It is changing it from a .DAT to a .TXT Full command should be ... EXEC master..xp_CmdShell 'Ren C:\Myfile.dat C:\Myfile.txt' You would of course change the Path and file name to correspond to your file name. Wrap this in a "Execute SQL Task" object w/in your DTS package and you are good to go! Thanks J. Kusch