Using Variables in SSIS Tasks

  • hi all,

    I have this procedure to remove certain characters from file names.

    The SQL Task has this: exec dbo.spCleanseFileName @strFileName = ?, @strFileNameCleansed = ?

    The stored procedure:

    CREATE PROCEDURE [dbo].[spCleanseFileName](@strFileName varchar(40),@strFileNameCleansed varchar(40) output)

    I have it in an SSIS package and my problem is that, after that SQL Task completes, the value for the

    ),@strFileNameCleansed variable is blank. I HAVE confirmed that the procedure DOES set the correct value inside the SP.

    What am I doing wrong, please?

    Thanks

  • You're missing the output clause in your SQL Task. I'm not sure that it solves the problem but it's part of it.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Thank you, Pouis. Your idea helped. I also had to tweak 1 line in my stored procedure. It works now and that variable value is available

    in other tasks. (I plan to rename the file after removing the invalid characters such as #- etc)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply