Showing posts with label parameter. Show all posts
Showing posts with label parameter. Show all posts

Thursday, March 8, 2012

AcquireConnection(txn) ?

In a script task I'm calling AcquireConnection(txn as Object) on a connection manager.

What is the txn parameter supposed to do or be used for?

I'm just passing an empty variable of type Object to this parameter and the method call is working fine...but I'm interested in knowing what its there for.

Thanks
JamieIt is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.|||

DarrenSQLIS wrote:

It is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.

Cool, that makes sense. I figured it was something I didn't have to worry about.

cheers Darren.

-Jamie|||Darren:
A follow-up on this: Ive been writitng a custom dataflow source that analyzes flatfiles by various properties (filesize, width etc.). The component works well when i have a stable flatfile connection. But when i do a for-each file in folder enumeration i cant get the updated connection information (ie filepath) from my component, it will always run against the first path passed by the connection manager. Any ideas on this?|||I've had issues with class level variables and loops since the class is only created once, that was a task though. Simple answer is I don't know, and don't have a suitable component to test with easily, but if you debug the component it should be very simple to work out what is going on. Put a break point on AcquireConnections for a start and see how many times it is called.

Another obvious test would be to add a script component, and make that consume the same connection, and just MsgBox out the connection string.

What do you get?|||

I have an SSIS package with its TransactionOption set to 'Required'. A data flow in the package has a script component that performs updates to a database table. The TransactionOption on the data flow is set to 'Supported'. However the script component does no get enlisted to the transaction because the updates made in the script component do not get rolled back when the package fails.

I'm thinking that I need to pass this 'transaction handle' to the AquireConnection method of the connection used by the script in order for the script to become part of the overall transaction.

In regard to your reply about transaction context. How do I determine it? I have no idea what value I should be passing. I am new to Sql Server beginning with Sql Server 2005. I have no background with DTC.

Thanks.

|||Please, one post will suffice. I have replied, and maybe even answered, in your new thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1322436&SiteID=1

AcquireConnection(txn) ?

In a script task I'm calling AcquireConnection(txn as Object) on a connection manager.

What is the txn parameter supposed to do or be used for?

I'm just passing an empty variable of type Object to this parameter and the method call is working fine...but I'm interested in knowing what its there for.

Thanks
JamieIt is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.|||

DarrenSQLIS wrote:

It is the transaction context you want to use for any work done in that connection. Think of DTC, you need a context that can be supplied to all connections that make up that transacction so all work is marshalled together, well this is that handle.

Passing null will pretty much always work. If you have a transaction context then pass it otherwise don't worry.

Cool, that makes sense. I figured it was something I didn't have to worry about.

cheers Darren.

-Jamie|||Darren:
A follow-up on this: Ive been writitng a custom dataflow source that analyzes flatfiles by various properties (filesize, width etc.). The component works well when i have a stable flatfile connection. But when i do a for-each file in folder enumeration i cant get the updated connection information (ie filepath) from my component, it will always run against the first path passed by the connection manager. Any ideas on this?
|||I've had issues with class level variables and loops since the class is only created once, that was a task though. Simple answer is I don't know, and don't have a suitable component to test with easily, but if you debug the component it should be very simple to work out what is going on. Put a break point on AcquireConnections for a start and see how many times it is called.

Another obvious test would be to add a script component, and make that consume the same connection, and just MsgBox out the connection string.

What do you get?|||

I have an SSIS package with its TransactionOption set to 'Required'. A data flow in the package has a script component that performs updates to a database table. The TransactionOption on the data flow is set to 'Supported'. However the script component does no get enlisted to the transaction because the updates made in the script component do not get rolled back when the package fails.

I'm thinking that I need to pass this 'transaction handle' to the AquireConnection method of the connection used by the script in order for the script to become part of the overall transaction.

In regard to your reply about transaction context. How do I determine it? I have no idea what value I should be passing. I am new to Sql Server beginning with Sql Server 2005. I have no background with DTC.

Thanks.

|||Please, one post will suffice. I have replied, and maybe even answered, in your new thread - http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1322436&SiteID=1

Friday, February 24, 2012

Accessing Values Parameter Values from another report

Hi, How can I display a value of a report parameter from one report into a textbox on another report?

If you are calling the 2nd report from the first, setup a parameter in the 2nd report, and pass that value to it from the first report. You can set this up in the navigation window.

BobP

Sunday, February 12, 2012

accessing parameters in a subreport

I have a report with an imbedded SubReport. I have set up the
subreport control to pass a parameter from the parent report to the
subreport. However, I'm stuck trying to actually use that parameter
within the subreport. This parameter will be used within a SQL
statement in the dataset tab.
I've tried setting a report parameter within the subreport and a
parameter within the dataset. I'm at a loss. Seems pretty simple, but
I'm obviously overlooking something. Any thoughts would be welcome.
ThanksSubreports are nothing special. They are a report that you have embedded.
You should design the report that will be used as a subreport first as a
report with report parameters. Test that report separately. Then after
embedding the report you do a right mouse click, parameters on the subreport
and map what the parameters should be.
Now, if you don't know how to use query parameters/report parameters that is
another matter and not really a subreport issue.
If you have a query that is like this:
select * from sometable where somefield = @.MyParam
Then RS automatically creates a report parameter called MyParam (note that
parameters are case sensitive).
When dealing with parameters you might be best to switch from graphical
designer mode to generic mode (the button is to the right of the ...).
Now, after embedding the report as a subreport you will map the MyParam
parameter to something in your main report. Either a field or a report
parameter.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
<dbutler_05@.hotmail.com> wrote in message
news:1166472829.204286.113100@.79g2000cws.googlegroups.com...
>I have a report with an imbedded SubReport. I have set up the
> subreport control to pass a parameter from the parent report to the
> subreport. However, I'm stuck trying to actually use that parameter
> within the subreport. This parameter will be used within a SQL
> statement in the dataset tab.
> I've tried setting a report parameter within the subreport and a
> parameter within the dataset. I'm at a loss. Seems pretty simple, but
> I'm obviously overlooking something. Any thoughts would be welcome.
> Thanks
>|||I figured it was something stupid simple. Just trying to make it hard
than it is.
Thanks for the help.
Bruce L-C [MVP] wrote:
> Subreports are nothing special. They are a report that you have embedded.
> You should design the report that will be used as a subreport first as a
> report with report parameters. Test that report separately. Then after
> embedding the report you do a right mouse click, parameters on the subreport
> and map what the parameters should be.
> Now, if you don't know how to use query parameters/report parameters that is
> another matter and not really a subreport issue.
> If you have a query that is like this:
> select * from sometable where somefield = @.MyParam
> Then RS automatically creates a report parameter called MyParam (note that
> parameters are case sensitive).
> When dealing with parameters you might be best to switch from graphical
> designer mode to generic mode (the button is to the right of the ...).
> Now, after embedding the report as a subreport you will map the MyParam
> parameter to something in your main report. Either a field or a report
> parameter.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> <dbutler_05@.hotmail.com> wrote in message
> news:1166472829.204286.113100@.79g2000cws.googlegroups.com...
> >I have a report with an imbedded SubReport. I have set up the
> > subreport control to pass a parameter from the parent report to the
> > subreport. However, I'm stuck trying to actually use that parameter
> > within the subreport. This parameter will be used within a SQL
> > statement in the dataset tab.
> >
> > I've tried setting a report parameter within the subreport and a
> > parameter within the dataset. I'm at a loss. Seems pretty simple, but
> > I'm obviously overlooking something. Any thoughts would be welcome.
> >
> > Thanks
> >

Accessing output parameter in Stored Proc. using OBDC API...

hi pals,
I would like to ge the output parameter using ODBC API, say
SQLExecDirect("EXEC SP_New") . How could I get the output parameter value
from my application?
note: forgive me if this group is not a relevant one.
Thanks and Regards,
shahul.Hi
For bound parameters you can call SQLBindParameter
http://msdn.microsoft.com/library/d...r />
_729e.asp
Also check out:
http://msdn.microsoft.com/library/d...>
t10_7t2s.asp
and the sample ProcessReturnCodes.cpp.
More information is at
http://support.microsoft.com/defaul...kb;en-us;152174
For unbound parameters you can call SQLGetData e.g.
http://support.microsoft.com/defaul...kb;en-us;241147
John
"Shahul" wrote:

> hi pals,
> I would like to ge the output parameter using ODBC API, say
> SQLExecDirect("EXEC SP_New") . How could I get the output parameter value
> from my application?
> note: forgive me if this group is not a relevant one.
>
> Thanks and Regards,
> shahul.
>
>

Accessing output parameter in Stored Proc. using OBDC API...

hi pals,
I would like to ge the output parameter using ODBC API, say
SQLExecDirect("EXEC SP_New") . How could I get the output parameter value
from my application?
note: forgive me if this group is not a relevant one.
Thanks and Regards,
shahul.
Hi
For bound parameters you can call SQLBindParameter
http://msdn.microsoft.com/library/de...dbc_b_729e.asp
Also check out:
http://msdn.microsoft.com/library/de...cht10_7t2s.asp
and the sample ProcessReturnCodes.cpp.
More information is at
http://support.microsoft.com/default...b;en-us;152174
For unbound parameters you can call SQLGetData e.g.
http://support.microsoft.com/default...b;en-us;241147
John
"Shahul" wrote:

> hi pals,
> I would like to ge the output parameter using ODBC API, say
> SQLExecDirect("EXEC SP_New") . How could I get the output parameter value
> from my application?
> note: forgive me if this group is not a relevant one.
>
> Thanks and Regards,
> shahul.
>
>

Accessing output parameter in Stored Proc. using OBDC API...

hi pals,
I would like to ge the output parameter using ODBC API, say
SQLExecDirect("EXEC SP_New") . How could I get the output parameter value
from my application?
note: forgive me if this group is not a relevant one.
Thanks and Regards,
shahul.Hi
For bound parameters you can call SQLBindParameter
http://msdn.microsoft.com/library/d...r />
_729e.asp
Also check out:
http://msdn.microsoft.com/library/d...>
t10_7t2s.asp
and the sample ProcessReturnCodes.cpp.
More information is at
http://support.microsoft.com/defaul...kb;en-us;152174
For unbound parameters you can call SQLGetData e.g.
http://support.microsoft.com/defaul...kb;en-us;241147
John
"Shahul" wrote:

> hi pals,
> I would like to ge the output parameter using ODBC API, say
> SQLExecDirect("EXEC SP_New") . How could I get the output parameter value
> from my application?
> note: forgive me if this group is not a relevant one.
>
> Thanks and Regards,
> shahul.
>
>