如何在存储过程中使用视图

时间:2013-12-06 21:35:20

标签: sql tsql stored-procedures view

如何在sql server中使用存储过程内的视图?我尝试过类似的东西,它说无法找到对象

CREATE VIEW myview
AS
  view code


CREATE PROCEDURE myprocedure
AS
  code using myview

2 个答案:

答案 0 :(得分:3)

为什么不只是select呢?

create procedure myProcedure 
as
  select * from myView

答案 1 :(得分:2)

create procedure myProcedure
 As 
  select * from myview

希望这有帮助