What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 3437 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > SQL Server > How to create view using stored procedure ...
Hariinakoti

How to create view using stored procedure

 Code Snippet posted by: Hariinakoti | Posted on: 9/13/2012 | Category: SQL Server Codes | Views: 605 | Status: [Member] | Points: 40 | Alert Moderator   


create proc CreateView
as
begin
Declare @SQL varchar(max)
set @SQL ='create view TEST1 as Select * from sys.tables'
exec(@SQL)
end

run the storedprocedure: EXEC CreateView

Thanks & Regards
Hari
Found interesting? Add this to:


 Responses

Jasminej
Posted by: Jasminej | Posted on: 9/15/2012 | Level: Starter | Status: [Member] | Points: 10 | Alert Moderator 

What will happen If I run the Procedure again and again ?


T.Saravanan
Posted by: T.Saravanan | Posted on: 9/15/2012 | Level: Silver | Status: [Member] [MVP] | Points: 10 | Alert Moderator 

Hi Hari,

Nice question from Jasminej. Please update your proc as rerunable and also post your code inside the code tag.

Thanks,
T.Saravanan

>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/25/2013 8:34:04 AM