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)
 view from stored procedure

Author  Topic 

nisar
Starting Member

29 Posts

Posted - 2009-02-23 : 01:19:58
Hi
I m running one stored procedure which returns around
1000 rows now i want to create view from this
stored procedure like a from stored procedure b
so i can select result like this

select * from a

anyone have idea about this

thanks and reagards
Nisar

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-02-26 : 06:58:34
you can not create a view from a stored procedure.
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-26 : 09:29:16
quote:
Originally posted by nisar

Hi
I m running one stored procedure which returns around
1000 rows now i want to create view from this
stored procedure like a from stored procedure b
so i can select result like this

select * from a

anyone have idea about this

thanks and reagards
Nisar




You can make it User-defined function and use in select.
Go to Top of Page

mk.vignesh
Starting Member

3 Posts

Posted - 2009-02-27 : 23:03:14
You can perform the following steps to achieve the task,

Create a table say A
Clear the table inside the SP and write the 1000 rows o/p to this table.
Create a view that has a definition Select * from A

Each time u invoke this SP the table will be updated and so is the view.

Nobody is Perfect in this world,I am Nobody
Go to Top of Page
   

- Advertisement -