How to create a view using procedure in sql?
In this article I have explained about how to create view using Stored Procedure.
You can create view in Stored procedure dynamically. In this example I'm going to create view for sys.tables.
create proc CreateView
Declare @SQL varchar(max)
set @SQL ='create view TEST1 as Select * from sys.tables'
To run Store Procedure :
To Select view Table
select * from TEST1