This is an easy one, at least I hope it is...I've changed the '' around for like the last 1/2 hour with no luck. I'm sure one of you is looking at this and rolling their eyes but any help would be most appreciated.I'm trying to insert a date into a file name without much luck.Declare @Date varchar(100);Declare @Sql varchar(MAX);SELECT @Date= REPLACE(CONVERT(VARCHAR(10), GETDATE(), 101), '/', '');print @DateSET @Sql='exec sp_ReplaceFileOrDirNames @pathToObject= ''c:\farfiles'', @oldName=''farUpload.txt'', @newName=''FARADATAL_OFK_'''+ @Date + '.DAT''' print @Sql
If you were to run this you would see an extra ' right before the date starts. 07062010exec sp_ReplaceFileOrDirNames @pathToObject= 'c:\farfiles', @oldName='farUpload.txt', @newName='FARADATAL_OFK_'07062010.DAT'
How can I get rid of the extra '?ThanksLaura