I would like to write a procedure that creates a view depending on its parameter in SQL Server 2005.
Grossly, this should look like this :
CREATE PROCEDURE testprocedure
@clientid float
as
create view testview as
select * from deliveries where clientid=@clientid
(but this does not work, it gives the error : Incorrect syntax near the keyword 'view'.)
Is it possible and how ?