Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Location
    DC
    Posts
    123

    Unanswered: DTS ActiveX BCP file manipulation

    Does anyone know the best way to handle this type of situation?

    A file coming into a directory based on the date filename042707
    I use the fileexist stored procedure to check for the existence.
    I use xp_cmdshell(sp)... stored procedure to rename the file so that
    it just has filename instead of the date.... I can not use
    variables within the xp_cmdshell to replace the date...
    everyday the filename would change to filename042807,filename042907 etc....

    Basically I know how to copy the file to another directory if it exists...
    then I want to strip the right 8 characters off... rename just to that
    but with the rename i have to know what the file will be named for that day ...
    excuse the grammar just somewhat tired...
    any suggestions... please thanks time for sleep

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    "DTS ActiveX BCP file manipulation"

    what on earth are you doing with ActiveX in SQL Server?

  3. #3
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    not sure where r u facing problem

    I can not use variables within the xp_cmdshell to replace the date...
    u can use variables withing xp_cmdshell like below
    Code:
    declare @cmd varchar(100)
    set @cmd = 'ren d:\file042807.xls  file' + replace(convert(varchar ,getdate(),1),'/','') + '.xls'
    exec master..xp_cmdshell @cmd
    Quote Originally Posted by jezemine
    what on earth are you doing with ActiveX in SQL Server?
    talking about ActiveX of DTS....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •