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
 ow to use view in storesd procedures

Author  Topic 

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2006-12-11 : 22:16:57
hi,i have created view and i want to use that view in stored procedures.is it possible to use in spc? if means please show some example that how to use,please

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-11 : 22:24:23
Definitely you can use views in the stored procs. The only thing that is unknown is what you want to do with the views...if its just selecting then no problem, but if you want to insert/update/delete through view, then you might have to check Updatable view criteria in BOL.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2006-12-11 : 22:38:41
hi harsh_athalye,can u show some example using vies in stored procedures,please
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-12-12 : 00:11:16
Why don't you try on your own and if found any problem, post here.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-12 : 05:52:40
quote:
Originally posted by born2acheive

hi harsh_athalye,can u show some example using vies in stored procedures,please


Did you try using Tables in stored procedures?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2006-12-13 : 00:18:28
hi madhivanan, i used tables in stored procedures,hw to use view in stored procedures please give me some example please
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2006-12-13 : 02:41:16
please any one show examples of using views in stored procedures,please any one reply me
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-12-13 : 03:11:36
You use a view EXACTLY the same way you use a table!

SELECT * FROM <YourViewNameHere>


It you want help faster, please do as asked for
quote:
Originally posted by harsh_athalye

Why don't you try on your own and if found any problem, post here.

Peter Larsson
Helsingborg, Sweden
Go to Top of Page

born2acheive
Yak Posting Veteran

65 Posts

Posted - 2006-12-13 : 03:37:24
hi Peso thanks a lot i did.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-12-13 : 10:17:17
There is no difference if you use Views in queries it is same as using tables

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -