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 2005 Forums
 Transact-SQL (2005)
 Renaming the Txt file

Author  Topic 

satya068
Posting Yak Master

233 Posts

Posted - 2010-09-16 : 17:38:14
Hi,

i got struck with this query,

this is my exec copy code for taking back-up:
exec( 'cmd','copy \\\\emp-di-go1\\Reality\\DATA_DAY\SALARY_DATA_DAY.TXT \\\\emp_di-go1\\Reality\\DATA_DAY_BACK_UP', 8 );

when executed this code SALARY_DATA_DAY.TXT was copyed into backup folder,with this i want to rename the file with date (ex:SALARY_DATA_DAY.TXT-16092010)the date should be the current date.

could you please tell me what code should include in the above exec script to populate date along with file name.

thanx in advance.

Satya

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-16 : 17:57:38
What process are you using to run that command? That is not a valid T-SQL command or Windows command, so I'm not familiar with it.



Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

satya068
Posting Yak Master

233 Posts

Posted - 2010-09-16 : 18:03:51
its a windows command,

can you please send me the link to windows forums,so i can try in that forums.

Satya
Go to Top of Page
   

- Advertisement -