Showing posts with label visual. Show all posts
Showing posts with label visual. Show all posts

Wednesday, March 21, 2012

Passing Command line arguments from Visual Studio

Hi all,

Is it possible to pass command line arguments to a package when running it from within VS? I want to set the value of a variable via the commandline, and found that you can to this in DtExec with the "/set \Package.Variables[...].Value;..." syntax. According to the docs, you should be able to pass the same argument via the 'CmdLineArguments' property in the 'Properties' dialog of an SSIS project in VS (CmdLineArguments. Run the package with the specified command-line arguments. For information about command-line arguments, see dtexec Utility), but unfortunately, this doesn't seem to work (even though the exact same argument does work when entered in DtExec)

Any help would be greatly appreciated :-)

Steven

No. Since you are in a IDE/Debug environment with Visual Studio, I think it is a minor limitation that you cannot do this, you can just change and set anything your require in the IDE.

If you have external configuration information you wish to set all the time then /SET is probably not the best solution. Using the built in Configurations support in SSIS would be a better choice and this does work in VS. See the SSIS menu.

|||

I have the exact same issue. I just need a single parameter that needs to change every time I call my package, so it doesn't really warrant external configuration. The following article implies that CmdLineArguments are only taken into account whenever you use dtexec externally to execute the package and then attach to it to debug. See the last section ("Testing and Debugging your code") for details.

http://msdn2.microsoft.com/en-us/library/ms403356.aspx

Passing Command line arguments from Visual Studio

Hi all,

Is it possible to pass command line arguments to a package when running it from within VS? I want to set the value of a variable via the commandline, and found that you can to this in DtExec with the "/set \Package.Variables[...].Value;..." syntax. According to the docs, you should be able to pass the same argument via the 'CmdLineArguments' property in the 'Properties' dialog of an SSIS project in VS (CmdLineArguments. Run the package with the specified command-line arguments. For information about command-line arguments, see dtexec Utility), but unfortunately, this doesn't seem to work (even though the exact same argument does work when entered in DtExec)

Any help would be greatly appreciated :-)

Steven

No. Since you are in a IDE/Debug environment with Visual Studio, I think it is a minor limitation that you cannot do this, you can just change and set anything your require in the IDE.

If you have external configuration information you wish to set all the time then /SET is probably not the best solution. Using the built in Configurations support in SSIS would be a better choice and this does work in VS. See the SSIS menu.

|||

I have the exact same issue. I just need a single parameter that needs to change every time I call my package, so it doesn't really warrant external configuration. The following article implies that CmdLineArguments are only taken into account whenever you use dtexec externally to execute the package and then attach to it to debug. See the last section ("Testing and Debugging your code") for details.

http://msdn2.microsoft.com/en-us/library/ms403356.aspx

sql

Monday, March 12, 2012

Passing a report parameter from a Visual C# form to a report parameter

Request is to have a Requirement number from the requirement form generate a report in Reporting Services with the requirement number as a filter.

I can set up the parameter - how does the value get there? Should I be asking this question in the Visual C# group?

Thanks!

Terry B

I hope this this article will help.

Friday, March 9, 2012

Pass value to stored procedure longer than 128 character

Hi all,

I want to pass a value longer more than 128 character but get an error.

what can i do?

I use sql 2005 and Visual Basic 6

thank'sI think you need to give a better description of the error; please give the exact message that you are getting. There is no problem passing an argument to a stored procedure that is longer than 128 characters. Also, can you potentially change the stored procedure and re-create or alter the stored procedure if the problem terns out to be the size of the argument?|||Thank for quikly response,

first i'm sorry about my english.

i was tried to pass parameter more small to the stored, and all was ok, the resultes are right.

I think the problem are only the lengh, i've only italian error description :

"La lunghezza del valore identificatore che inizia con '*MY PARAMETER*' è eccessiva.
La lunghezza massima consentita è 128."

I've edit stored for replace value more small to real value.

Example:

'VALUES EXPLANATION
SHORT VALUE REAL VALUE
DOF DATAORAFINE
DOS DATAORASCADENZA
DOI DATAORAINIZIO
'**************************************

'STORED CODE
SET @.CRITDATA = REPLACE(@.CRITDATA,'DOF','DATAORAFINE')
SET @.CRITDATA = REPLACE(@.CRITDATA,'DOS','DATAORASCADENZA')
SET @.CRITDATA = REPLACE(@.CRITDATA,'DOI','DATAORAINIZIO')

There is an other solution

thank's
Davide|||

Can you post the entire procedure? This works:

create procedure test
(
@.parameter varchar(200)
) as
select len(@.parameter), @.parameter
go
exec test '01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'
go

Returns:

-- --
200 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789

|||all right,

I've used double apen fore execute query from SQL MANAGEMENT STUDIO, now with the single apex work!

Thanks a lot|||

Just to be clear.

You were putting double quotes ("text") around the argument rather than single('text').

The problem was that putting double quotes around the text is the same as putting it in square brackets ([text]). This means that the text is treated as an identifier (and not as text), and identifiers in SQL Server are limited to 128 characters.

Thought we ought to make it clear what the problem had been and how it had been fixed.

|||

"You were putting double quotes ("text") around the argument rather than single('text'). "

Ah, nice catch. That went right over (past) my head, if only I could have read Italian (from google's translator:)

“The length of the identificatore value that it begins with “*MY PARAMETER*” is excessive. The concurred maximum length is 128.”

D'oh!