Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 My SP brings back the wrong values!

Author  Topic 

Johnhamman
Starting Member

37 Posts

Posted - 2002-08-02 : 15:54:12
Hi my stored procedure only seems to bring back one value back and not two. it only brings back @mastermsg and not sitemsg.


CREATE PROCEDURE AdmingetMessages
(
@siteID int,
@sitemsg nvarchar(4000) output,
@mastermsg nvarchar(400) output
)
AS
Select @sitemsg = Msg from Admin_siteMsg
where siteID = @siteID and DateEnd > GETDATE()

Select @mastermsg = msg from Admin_siteMsg
where siteID = @siteID and DateEnd > GETDATE()
And masterMsg = '1'


rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-08-04 : 22:03:24
OK - this may be a really dumb question. But do you actually have a line at the end that says:
select @mastermsg
select @sitemsg


and if you want it all in one recordset don't forget to union...

select @mastermsg
union
select @sitemsg


--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2002-08-05 : 00:00:25
Or maybe:

select mastermsg = @mastermsg, sitemsg = @sitemsg

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-08-05 : 00:48:36
that too- if you want them as diff columns......thanks graz

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

Edited by - rrb on 08/05/2002 00:50:01
Go to Top of Page
   

- Advertisement -