October 7, 2008 at 8:10 am
[font="Tahoma"]I have the following SELECT statement:
SELECT convert(int, timestamp), value, status FROM (EXEC sp_trendView ....)
and it generates the following error:
Expecting a table name
(this isn't in SS2005)
Could someone point out the correct syntax or just let me know it's not possible?[/font]
October 7, 2008 at 8:17 am
You cannot select from a stored procedure. If you need to query data from a stored procedure you need to insert the results of the stored procedure into a table (variable, temp, or permanent) and the query the table. Or you can rewrite the stored procedure as a table-valued function assuming you are on 2000 or 2005. Please check the forum next time because you normally will get a 2005 answer in a 2005 forum.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
October 7, 2008 at 8:19 am
Thanks Jack, that's what I needed to know.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply