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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stored Procedure - Create view

Status
Not open for further replies.

sqlp

IS-IT--Management
Oct 13, 2000
1
US
Since one cannot use CREATE VIEW within a Stored Procedure, is there a way to overcome that limitation? Any help in this regard is appreciated. [sig][/sig]
 
Why would you want to create a view in a stored procedure?

You might explore using DECLARE to create a cursor instead. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Rob is right, a cursor could be used but you may have other reasons for wanting a View... the view will leave a permanent way of accessing data in tables and be have more efficient use of resources.

The only way to do really sneaky things like creating views from stored procedures is to generate a string or text file of sql statements from the sp and run it using a xp_cmdshell....the create view will then be being run by the shell user and not the sp. [sig]<p> <br><a href=mailto: > </a><br><a href= home</a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top