SQL Server Performance

Problem in renaming the Physical Filename.

Discussion in 'SQL Server DTS-Related Questions' started by gangulyarindam, Apr 23, 2005.

  1. gangulyarindam New Member

    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
  2. dineshasanka Moderator

    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

Share This Page