I have a strange problem, I want to execute different stored procedures based on certain criteria defined in the database. I am able to execute the sp using the sp_executesql system stored procedure.
Exec sp_executesql Nexec procedurename {parameterlist}, N{parameter declaration}, Parametervalues
Now I want to read a particular value that is being return be the procedure.
NOTE: procedure is returning a resultset.
Please help me.
Thanks!In Books OnLine, look up the keywords OUTPUT variable and RETURN.|||Hmmm...not sure if the OUTPUT parameters alone will do the job, as dynamic SQL operates within its own scope. Try it and see, but you can also use temp tables as a hack method to pass values across scopes.|||I have a strange problem, I want to execute different stored procedures based on certain criteria defined in the database. I am able to execute the sp using the sp_executesql system stored procedure.
Exec sp_executesql Nexec procedurename {parameterlist}, N{parameter declaration}, Parametervalues
Now I want to read a particular value that is being return be the procedure.
NOTE: procedure is returning a resultset.
Please help me.
Thanks!
Try This
DECLARE @.sql nvarchar(2048)
SET @.sql = ' SET @.count = ( SELECT COUNT(*) FROM table1 )'
DECLARE @.temp int
EXEC sp_executesql @.sql, N'@.count int OUTPUT', @.temp OUTPUT
Jamessql
Showing posts with label criteria. Show all posts
Showing posts with label criteria. Show all posts
Thursday, March 29, 2012
Tuesday, March 27, 2012
Executing multiple reports to form single document
Hi Everyone!
In my project I have lot of small small reports having the same criteria
e.g. Company and Years, the requirement here is to execute all these reports
and create a single document that can be delivered to customer's customer. I
am not able to find any such posting in this group or not able to find any
pointers on this.
Your help on this would be really appreciated.
Thanks in Advance
--
CloudsYou could use subreports as a way of combining your multiple reports. You
would have one "master" report that consisted of simply several subreports.
That would enable you to run the master and export it.
Mike G.
"Clouds" <Clouds@.discussions.microsoft.com> wrote in message
news:56C49443-0E2F-401A-B5B8-5D694B2D8780@.microsoft.com...
> Hi Everyone!
> In my project I have lot of small small reports having the same criteria
> e.g. Company and Years, the requirement here is to execute all these
> reports
> and create a single document that can be delivered to customer's customer.
> I
> am not able to find any such posting in this group or not able to find any
> pointers on this.
> Your help on this would be really appreciated.
> Thanks in Advance
> --
> Clouds
In my project I have lot of small small reports having the same criteria
e.g. Company and Years, the requirement here is to execute all these reports
and create a single document that can be delivered to customer's customer. I
am not able to find any such posting in this group or not able to find any
pointers on this.
Your help on this would be really appreciated.
Thanks in Advance
--
CloudsYou could use subreports as a way of combining your multiple reports. You
would have one "master" report that consisted of simply several subreports.
That would enable you to run the master and export it.
Mike G.
"Clouds" <Clouds@.discussions.microsoft.com> wrote in message
news:56C49443-0E2F-401A-B5B8-5D694B2D8780@.microsoft.com...
> Hi Everyone!
> In my project I have lot of small small reports having the same criteria
> e.g. Company and Years, the requirement here is to execute all these
> reports
> and create a single document that can be delivered to customer's customer.
> I
> am not able to find any such posting in this group or not able to find any
> pointers on this.
> Your help on this would be really appreciated.
> Thanks in Advance
> --
> Clouds
Friday, February 17, 2012
execute functions in sql reporter service
Hello
a. How can I calculate in a function in SQL reporter the date for tomorrow.
Now I've filled in a criteria {fn > now()} which shows me all the coming
projects from today.
I only want to show reports for tomorrow. I know how to do it in VB.NET but
can I used in SQL reporter service ?
b. When I export date values to excel, they are shown as numeric value. In
PDF exporter, it works fine? I've changed my dateformat several times,
nothing helps
c. I need a function like this. I a certain value is smaller than 10, the
word "LOW VALUE" is reporter, otherwise the word "HIGH VALUE" is shownReport expressions are essentially VB.NET
So you should be able to everything inside of the expressions.
With the only caveat is that when report is compiled, by default we import
only following namespaces:
System, System.Convert, System.Math and Microsoft.VisualBasic
If you want to get something from any other namespace you'll need to use
full name notation which include full namespace.
"DEME-Carlo" <DEME-Carlo@.discussions.microsoft.com> wrote in message
news:931C2DD3-84A2-4526-A761-55C5A465E12C@.microsoft.com...
> Hello
> a. How can I calculate in a function in SQL reporter the date for
tomorrow.
> Now I've filled in a criteria {fn > now()} which shows me all the coming
> projects from today.
> I only want to show reports for tomorrow. I know how to do it in VB.NET
but
> can I used in SQL reporter service ?
> b. When I export date values to excel, they are shown as numeric value.
In
> PDF exporter, it works fine? I've changed my dateformat several times,
> nothing helps
> c. I need a function like this. I a certain value is smaller than 10,
the
> word "LOW VALUE" is reporter, otherwise the word "HIGH VALUE" is shown
>
>
>
>
a. How can I calculate in a function in SQL reporter the date for tomorrow.
Now I've filled in a criteria {fn > now()} which shows me all the coming
projects from today.
I only want to show reports for tomorrow. I know how to do it in VB.NET but
can I used in SQL reporter service ?
b. When I export date values to excel, they are shown as numeric value. In
PDF exporter, it works fine? I've changed my dateformat several times,
nothing helps
c. I need a function like this. I a certain value is smaller than 10, the
word "LOW VALUE" is reporter, otherwise the word "HIGH VALUE" is shownReport expressions are essentially VB.NET
So you should be able to everything inside of the expressions.
With the only caveat is that when report is compiled, by default we import
only following namespaces:
System, System.Convert, System.Math and Microsoft.VisualBasic
If you want to get something from any other namespace you'll need to use
full name notation which include full namespace.
"DEME-Carlo" <DEME-Carlo@.discussions.microsoft.com> wrote in message
news:931C2DD3-84A2-4526-A761-55C5A465E12C@.microsoft.com...
> Hello
> a. How can I calculate in a function in SQL reporter the date for
tomorrow.
> Now I've filled in a criteria {fn > now()} which shows me all the coming
> projects from today.
> I only want to show reports for tomorrow. I know how to do it in VB.NET
but
> can I used in SQL reporter service ?
> b. When I export date values to excel, they are shown as numeric value.
In
> PDF exporter, it works fine? I've changed my dateformat several times,
> nothing helps
> c. I need a function like this. I a certain value is smaller than 10,
the
> word "LOW VALUE" is reporter, otherwise the word "HIGH VALUE" is shown
>
>
>
>
Subscribe to:
Posts (Atom)