Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 8th, 2004, 01:42 PM
ea ea is offline
Registered User
 
Join Date: Nov 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stored Procedures Inside of Views

Is this allowed? I want to retrieve results of a Select statement that has parameters and that statement within another view.

If a stored procedure returns a result set, could it be included in a view? If so, how? If not, how do you go around it?

Thanks for any help,
ea


 
Old December 8th, 2004, 07:07 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Not quite clear, can you explain it little bit more

Also think about use dynamic SQL

for example:
Code:
exec ('create view test as select * from employees where [reportsto]=2'
Jaime E. Maccou
 
Old December 9th, 2004, 10:19 AM
ea ea is offline
Registered User
 
Join Date: Nov 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for responding. I wanted to know if there was a way to use stored procedures inside of a view. I've got these queries that use parameters so I had to make them stored procedures. However the SP returns a result set which I would like to use inside a view. I wanted to know if that was allowed. And if not, is there a work-around for it.

ea

 
Old December 9th, 2004, 06:11 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Can you post your view and or store procedure?

Jaime E. Maccou





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Procedures KeviJay VB Databases Basics 1 June 5th, 2008 07:17 AM
Using System Tables, Views and Stored Procedures syphon SQL Server ASP 2 September 6th, 2006 03:09 AM
Stored Procedures jazzcatone Classic ASP Databases 0 August 28th, 2005 02:57 PM
Stored Procedures stu9820 Access 3 February 8th, 2004 01:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.