Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a simple view from a sproc

Status
Not open for further replies.

Naith

Programmer
May 14, 2002
2,530
GB
Hi,

I'm coming from a different rdbms school, and new to SQL Server. I was wondering how it's possible to create a view in a stored procedure, passing a parameter value into it assigned from another stored procedure.

Thanks
 
Maybe I don't understand you rught, but I don't see any reason to create a View IN SP code. If you need to use SP, you could run your select in it with all parameters needed. If you need View create it first and than run it from SP.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Perhaps I'm not thinking of the best way to handle this, but let me give you a quick synopsis, and maybe you can tell me whether this is the right approach.

I have a view which exists to have denormalised data from other tables.

I'm trying to incorporate the view in the sproc to allow for full automation with minimal disruption to other procedures, which also uses the denormalised views.

This is why I wanted to know if it was possible to create a view within a stored procedure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top