Showing posts with label sets. Show all posts
Showing posts with label sets. Show all posts

Monday, March 19, 2012

Getting records output from stored procedure into a table

I have a stored procedure that returns two sets of records, and I want to
execute the procedure and insert the second set of records into a temporary
table outside the procedure.
The last lines of the stored procedure look like this:
--Return count of programs first
SELECT COUNT(*)
FROM #Programs
--Return programs
SELECT *
FROM #Programs
ORDER BY
Day1Date
I have tried the following but this only captures the first set of records
(the count):
INSERT INTO #temp EXECUTE StoredProc
I cannot change the stored procedure. Is there a way to get the second set
into a temprary table (or even permanent table, table variable etc) ?This is a multi-part message in MIME format.
--=_NextPart_000_0067_01C3C3BB.8715A830
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: 7bit
Consider using an output parameter to store the count:
-- inside the called proc
SELECT @.count = COUNT(*)
FROM #Programs
-- inside the calling proc
declare @.count int
INSERT INTO #temp
EXECUTE StoredProc @.count output
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OSwOuR#wDHA.3116@.TK2MSFTNGP11.phx.gbl...
I have a stored procedure that returns two sets of records, and I want to
execute the procedure and insert the second set of records into a temporary
table outside the procedure.
The last lines of the stored procedure look like this:
--Return count of programs first
SELECT COUNT(*)
FROM #Programs
--Return programs
SELECT *
FROM #Programs
ORDER BY
Day1Date
I have tried the following but this only captures the first set of records
(the count):
INSERT INTO #temp EXECUTE StoredProc
I cannot change the stored procedure. Is there a way to get the second set
into a temprary table (or even permanent table, table variable etc) ?
--=_NextPart_000_0067_01C3C3BB.8715A830
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Consider using an output parameter to =store the count:
-- inside the called =proc
SELECT @.count =3D =COUNT(*)FROM #Programs
-- inside the calling =proc
declare @.count int
INSERT INTO #temp
EXECUTE StoredProc @.count output
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Laurence Neville" wrote in message news:OSwOuR#wDHA.3116=@.TK2MSFTNGP11.phx.gbl...I have a stored procedure that returns two sets of records, and I want toexecute the procedure and insert the second set of records into a temporarytable outside the procedure.The last lines of the =stored procedure look like this:--Return count of programs =firstSELECT COUNT(*)FROM #Programs--Return programsSELECT *FROM #ProgramsORDER BYDay1DateI have tried the following but =this only captures the first set of records(the count):INSERT =INTO #temp EXECUTE StoredProcI cannot change the stored procedure. Is there =a way to get the second setinto a temprary table (or even permanent table, =table variable etc) ?

--=_NextPart_000_0067_01C3C3BB.8715A830--

Friday, February 24, 2012

Getting Field List to display in Reporting Services 2005

In VS2005 Report Designer how do you get the field list to display. In VS2003, The field list for the data sets shows on the left side of the screen under the toolbox without having to do anything. In 2005 I don't know how to make it appear at all. Any help, thanks in advance.

Ctrl-Alt+D or from the last item on the View menu, select Datasets.

This posting is provided "AS IS" with no warranties, and confers no rights.

|||

The last item on my view menu is greyed out "property pages". Is that the item you are referring to? Datasets does not show anyplace.

When I click the Ctrl-Alt+D the system just displays the hourglass and does nothing.

|||Sorry Mary, I was too quick to respond. Your suggestion worked perfectly. I now have my dataset field list. How do I code a function for a report? I need to get info from a dataset and create a concatenated string. I know how to do it but I need to code the function in report designer.