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 2008 Forums
 Transact-SQL (2008)
 Views and Stored Procedures.

Author  Topic 

viperbyte
Posting Yak Master

132 Posts

Posted - 2011-12-15 : 11:52:51
Can a Stored Procedure call a View? If so how do you do that? I can't find the info anywhere.

X002548
Not Just a Number

15586 Posts

Posted - 2011-12-15 : 12:00:13
you would use a view just like you would use a table in a sproc

What do you mean "call" a view?


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

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-12-15 : 12:00:18
A view is just like table. So to access it just do a select statement just like on a table
select *
from yourView

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

viperbyte
Posting Yak Master

132 Posts

Posted - 2011-12-15 : 16:17:52
Brett I mean the in the body of the Stored Procedure somehow a view could be used as a table like usual. I guess that sounds nuts. Thanks guys for your help and input. And thank you again Jim for saving my butt.
Go to Top of Page
   

- Advertisement -