Reputation: 45
I have a question for SQL Server Management Studio.
How can I call view in a stored procedure?
Upvotes: 1
Views: 10079
Reputation: 62
I really cant understand what you want to know or to do. This is useless code, but maybe it can be helpfull:
use [AdventureWorks2012]
GO
create view dbo.EMP
as
SELECT [BusinessEntityID]
,[NationalIDNumber]
,[LoginID]
,[OrganizationNode]
,[OrganizationLevel]
,[JobTitle]
,[BirthDate]
,[MaritalStatus]
,[Gender]
,[HireDate]
,[SalariedFlag]
,[VacationHours]
,[SickLeaveHours]
,[CurrentFlag]
,[rowguid]
,[ModifiedDate]
FROM [HumanResources].[Employee]
where jobtitle = N'Research and Development Manager'
GO
create procedure dbo.p_select_from_EMP_view
as
begin
select * from dbo.EMP
end
GO
exec dbo.p_select_from_EMP_view
Upvotes: 4