Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts

Monday, March 26, 2012

Newbie question - how do I specify a variable for the file location when using the Execute Packa

There are two options to specify the subpackage location (SQL Server or file location). I'd like to know how I can specify a variable name that points to the file location so I avoid hard coding the file location which could change during production installation.
thanks

This is a start.
http://sqljunkies.com/WebLog/knight_reign/archive/2005/11/12/17375.aspx
Thanks,
K|||

To do this you must work on the file connection manager not on the task.

You go and add a property expression to Expression colection of the CM that would map your variable to the ConnectionString property of the CM.

Thanks,
Ovidiu

|||

Hi, I'm another newbie.

Can you give a short example of how to do that?

Thanks,

Roger

|||

Hi Ovidu,

Thanks for the reply. Yes, I am working in the connection manager. The problem I'm having is getting the connectionstring property to recognize a string variable. I've played with it a lot and the only syntx that I've tried that doesn't cause an error on entry is @.MyVariable. but, when I run the package, it is interpreted as a file name, which it doesn't find.

Tha variable is in scope. When I substitute a script task with a msgbox, I can step through the files. Can you show me a short example of how you'd do it?

Thanks, again,

Roger

Newbie question - how do I specify a variable for the file location when using the Execute Packa

There are two options to specify the subpackage location (SQL Server or file location). I'd like to know how I can specify a variable name that points to the file location so I avoid hard coding the file location which could change during production installation.
thanks

This is a start.
http://sqljunkies.com/WebLog/knight_reign/archive/2005/11/12/17375.aspx
Thanks,
K|||

To do this you must work on the file connection manager not on the task.

You go and add a property expression to Expression colection of the CM that would map your variable to the ConnectionString property of the CM.

Thanks,
Ovidiu

|||

Hi, I'm another newbie.

Can you give a short example of how to do that?

Thanks,

Roger

|||

Hi Ovidu,

Thanks for the reply. Yes, I am working in the connection manager. The problem I'm having is getting the connectionstring property to recognize a string variable. I've played with it a lot and the only syntx that I've tried that doesn't cause an error on entry is @.MyVariable. but, when I run the package, it is interpreted as a file name, which it doesn't find.

Tha variable is in scope. When I substitute a script task with a msgbox, I can step through the files. Can you show me a short example of how you'd do it?

Thanks, again,

Roger

sql

Wednesday, March 7, 2012

newbie ? about stored procedures

I currently have several sprocs that require a variable which determines
which set of fields get returned. For ex: X returns fields 1, 2, 3 and Y
returns fields 4, 5, 6. When I run the sprocs the appropriate fields show up
in the results window but when I refresh the fields, reguardless of what
variable I used it displays X's fields in the fields window. Can I not create
two datasets running the same sproc using different variables. If not is this
so this something that I'll be able to do in the near future? Any help would
be most appreciated.Hey there,
As far as I know Reporting Services scans the Stored Procedure, caches the
field names and uses those.
Why don't you have your stored procedure return generic colum names such as
"Col1", "Col2", "Col3" and then apply some conditional formatting on those
column headers when they're placed on the report. Something like this:
txtColumn1.Value = IIF(Parameters!MyCondition.Value = "X", "Zip Code",
"Postal Code")
I'm pretty sure that this is by design since Reporting Services needs to
know the column names.
Hopefully I'm on the same page as you...
Ben
"Arly" <Arly@.discussions.microsoft.com> wrote in message
news:045E8DA3-0DA9-4EAE-9A7E-91343815D69D@.microsoft.com...
> I currently have several sprocs that require a variable which determines
> which set of fields get returned. For ex: X returns fields 1, 2, 3 and Y
> returns fields 4, 5, 6. When I run the sprocs the appropriate fields show
up
> in the results window but when I refresh the fields, reguardless of what
> variable I used it displays X's fields in the fields window. Can I not
create
> two datasets running the same sproc using different variables. If not is
this
> so this something that I'll be able to do in the near future? Any help
would
> be most appreciated.|||Thanks, Ben but that would mean changing hundreds of sprocs that are being
used by our VB programmers as well. Any other ideas?
"Benjamin Pierce" wrote:
> Hey there,
> As far as I know Reporting Services scans the Stored Procedure, caches the
> field names and uses those.
> Why don't you have your stored procedure return generic colum names such as
> "Col1", "Col2", "Col3" and then apply some conditional formatting on those
> column headers when they're placed on the report. Something like this:
> txtColumn1.Value = IIF(Parameters!MyCondition.Value = "X", "Zip Code",
> "Postal Code")
> I'm pretty sure that this is by design since Reporting Services needs to
> know the column names.
> Hopefully I'm on the same page as you...
>
> Ben
>
> "Arly" <Arly@.discussions.microsoft.com> wrote in message
> news:045E8DA3-0DA9-4EAE-9A7E-91343815D69D@.microsoft.com...
> > I currently have several sprocs that require a variable which determines
> > which set of fields get returned. For ex: X returns fields 1, 2, 3 and Y
> > returns fields 4, 5, 6. When I run the sprocs the appropriate fields show
> up
> > in the results window but when I refresh the fields, reguardless of what
> > variable I used it displays X's fields in the fields window. Can I not
> create
> > two datasets running the same sproc using different variables. If not is
> this
> > so this something that I'll be able to do in the near future? Any help
> would
> > be most appreciated.
>
>

Saturday, February 25, 2012

newbie - DEBUG MODE?

Hello,
I have a query I'm working on in the Query Analyzer. My query has
variables...I wanted to know if there is a way to track the variable and
see its value (I.e. step through) is there a debug mode in the Query
Analyzer?
Thanks in advance.You can use SQL Debbuger.
From Query Analyzer, right-click on the stored procedure in the Object
Browser and select Debug. That will open SQL Debuuger.
"Fab" wrote:

> Hello,
> I have a query I'm working on in the Query Analyzer. My query has
> variables...I wanted to know if there is a way to track the variable and
> see its value (I.e. step through) is there a debug mode in the Query
> Analyzer?
> Thanks in advance.
>
>|||COOL THANKS JACK!
"Jack" <Jack@.discussions.microsoft.com> wrote in message
news:7BCCA5CF-34FC-44B7-820D-29D35A68F263@.microsoft.com...
> You can use SQL Debbuger.
> From Query Analyzer, right-click on the stored procedure in the Object
> Browser and select Debug. That will open SQL Debuuger.
> "Fab" wrote:
>