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 2005 Forums
 Transact-SQL (2005)
 View using procedure

Author  Topic 

legendmaddy
Starting Member

3 Posts

Posted - 2009-06-23 : 08:11:38
Hi all,
i want to know wheather we can use a stored procedure in a view ....say
create view as
Exec Sp_test.
this wont work..
is it possible to create view with procedure????

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-06-23 : 08:18:08
create a table valued function instead

http://msdn.microsoft.com/en-us/library/ms191165.aspx
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-23 : 08:41:01
Yes.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

legendmaddy
Starting Member

3 Posts

Posted - 2009-06-24 : 01:53:23
how can we use a store procedure..can u plz explain
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-06-24 : 02:02:49
You can use OPENROWSET and set the remote server (linked server) to self, and have the stored procedure as data source.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page
   

- Advertisement -