Problem in renaming the Physical Filename. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Problem in renaming the Physical Filename.

Hi, I am designing a SQL Script that will detect an Excel File in a Particular Location, rename it to another Stanadrd Filename and then simply Import it using OPENROWSET Method. My Script is being able to locate the Excel File location but can’t rename it to my defined name. It sends me the error return value -2147352570 when I execute the following query : EXEC @resSM = sp_OAMethod @objectFSO, ‘RenameFile’, @OnSuccess OUT, @FileName, @NewFileName Can someone help me in resolving the problem. Thanks & Regards, Arindam Ganguly
http://www.sqldts.com/default.aspx?292
in this check the scetion Move or Rename File
quote:Originally posted by gangulyarindam Hi, I am designing a SQL Script that will detect an Excel File in a Particular Location, rename it to another Stanadrd Filename and then simply Import it using OPENROWSET Method. My Script is being able to locate the Excel File location but can’t rename it to my defined name. It sends me the error return value -2147352570 when I execute the following query : EXEC @resSM = sp_OAMethod @objectFSO, ‘RenameFile’, @OnSuccess OUT, @FileName, @NewFileName Can someone help me in resolving the problem. Thanks & Regards, Arindam Ganguly

]]>