Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename file from stored procedure

Status
Not open for further replies.

jeffwest21

IS-IT--Management
Apr 4, 2013
60
GB
I have a series of files that I am importing into my database, this I can do no problem, my issue is with moving the files afterwards.

I want to move them into a \done\todaysdate folder, again, I can create the folder and three of the four files move into my folder, the fourth doesn't, I am guessing because the file name length is to long.

My issue is trying to rename this file so that it will move, the file will not have a standard name as it has a date created at the end (this is coming from a third party and I cant change it unfortunatly).

How can I get my stored procedure to rename the file using a wild card, the start of the name is always going to the 'servicecdrinformation'

I have tried doing this as part of my batch file that runs the sp, and I have tried the sp itself, but can't seem to get the syntax right, I am almostv finished with this if I can get this bit working.

'Clever boy...'
 
Managed to solve this in the end by using a couple of variables to hold the file name and file path.

'Clever boy...'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top