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
 General SQL Server Forums
 New to SQL Server Programming
 Displaying record results of a stored procedure

Author  Topic 

wleonard
Starting Member

30 Posts

Posted - 2011-03-02 : 16:17:30
Hi. I have a stored procedure that has a small string of code that I would like to display the result of in the following:


update a set newpartdesc = case when datediff(d, a.create_date, getdate()) > 7 and datediff(d, a.create_date, getdate()) < 30 then
rtrim(convert(char(5), datediff(d, a.create_date, getdate())/7)) + ' weeks ago'
when datediff(d, a.create_date, getdate()) <= 7 then
rtrim(convert(char(5), datediff(d, a.create_date, getdate()))) + ' days ago'
else rtrim(convert(char(5), datediff(d, a.create_date, getdate())/30)) + ' months ago' end
from @TempTable a
where a.newflag = 1



Okay.....I want to display the result of the code in ASP. Using the objRs, how is this achievable to display the results of a single string of code inside a stored procedure? I know I must perform an exec statement, however this stored procedure is very large and contains other parts I don't want included. All I want is to display the result of the code you see above using a Response.Write() and an objRs(). Help please.

Will Leonard

X002548
Not Just a Number

15586 Posts

Posted - 2011-03-02 : 16:26:10
What do you mean by "DISPLAY THE RESULT?"

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

wleonard
Starting Member

30 Posts

Posted - 2011-03-02 : 17:04:02
Display the query execution result.

Will Leonard
Go to Top of Page
   

- Advertisement -