Variables for SSIS in SQL Agent

  • Morning All,

    This problem is driving me up the wall!!

    I've an SSIS package that accepts 3 variables, all network paths. However the paths with spaces in them (which I cannot easily avoid) is causing problems - I looked up this problem and it seems its common, and a adding a trailing slash to the END of the path sorts this - however now in my case!

    Here is my call:

    /DTS "\"\MSDB\Import KIT Data\"" /SERVER myserver /CHECKPOINTING OFF /REPORTING V /SET "\"\Package.Variables[User::SourcePath].Value\"";"\"\\ing.local\ingeus\NCS_EOI_Repository_share\Keep warm comms\KIT Automated Tool\System Testing\\"" /SET "\"\Package.Variables[User::QuarantineFolder].Value\"";"\"\\ing.local\ingeus\NCS_EOI_Repository_share\Keep warm comms\KIT Automated Tool\System Testing\Failed Imports\\"" /SET "\"\Package.Variables[User::SuccessFolder].Value\"";"\"\\ing.local\ingeus\NCS_EOI_Repository_share\Keep warm comms\KIT Automated Tool\System Testing\Successful Imports\\""

    The error I Am getting from SQL Agent is

    Option "warm" is not valid. The command line parameters are invalid. The step failed.

    Any help would be appreciated.

    Cheers All

    Alex

  • Alex

    Yes, it's very easy to tie yourself in knots trying to escape your quotes with backslashes. I don't know whether it's an option for you, but I use 8.3 notation where the paths have spaces in them. Go to a command prompt and navigate to the folder above the one with the space, then type [font="Courier New"]dir /x /ad[/font] for a list of all subfolders in 8.3 notation. If some of the paths you're specifying are external to your organisation, you may have to contact the owners to ask them for the information.

    John

  • Ah John, I didn't realise I could do that! So WITHOUT renaming the directories, I can still reference them with 8.3 notation?

  • Indeed you can.

    John

  • John thanks so much! That got me a little bit futher!

    However, now when I use the 8.3 filenames from sqagent it doesnt find any files (succeeds, but does nothing, I know its running the package as it is truncating the table at the beginning).

    If I put the 8.3 filename in the package and run that manually it imports the files just fine....

    So I would say that rules out the filename, and more how the variables are being passe in.

    I don't suppose there is another way of getting variables into a SSIS package as this /SET method is incredibly clunky!

    Cheers,

    Alex

  • Alex

    You can use Package Configurations and pass in the variable value via the config file or table, or you can have the package fetch the value at runtime, for example by querying a table. Or you can use a parent package variable if your package is called by another package - this is where the variable takes its value from a specified variable in the parent package.

    John

  • I wondered about package configurations, but I don't have the option on the menu where everyone else on the internet seems to!

  • What version of BIDS/SSDT are you using? Make sure you're at the top level of the package (ie not in a data flow) and then look in the menu. You can also find the option by right-clicking on an empty area of the package surface.

    John

  • I've managed to find it with the help of this link:

    http://dataqueen.unlimitedviz.com/2012/01/ssis-2012-package-configurations-menu-option-missing/

    I'm using SSDT for Visual Studio 2013 on top of SQL Server 2014

    I'm now trying to create a .dtsconfig, but the interface acts erratically and deselects certain properties!!

  • Hiya!

    Just to let you that between the 8.3 format file paths and the package configs I have solved problem.

    Thanks guys, appreciated.

    Alex

Viewing 10 posts - 1 through 9 (of 9 total)

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