• Koen, FYI

    "INSERT INTO [dbo].[Doc_Stage](DocName,DocPath,DocType) VALUES ('" +REPLACE(RIGHT(@[User::FilePath],FINDSTRING(Reverse(@[User::FilePath] ) ,"\\", 1)-1),RIGHT(@[User::FilePath],4),"")+ "','" + @[User::FilePath] + "','" + RIGHT( @[User::FilePath] ,FINDSTRING( REVERSE(@[User::FilePath] ),".",1)-1)+ "');"

    I googled and found the above method of inserting the document name. I use this statement to insert the file name dynamically using a for loop containser and execute SQL task.....but this statement is not validated by the expression of execute sql task....could you help me please...?

    Thanks,
    Charmer