当前位置: 代码迷 >> Sql Server >> 视图中能访问临时表么?该怎么解决
  详细解决方案

视图中能访问临时表么?该怎么解决

热度:95   发布时间:2016-04-27 12:46:09.0
视图中能访问临时表么?
CREATE PROCEDURE [dbo].aspnet_Vstock_Order_MakeDealStr
@xmlData varchar(8000)
AS
BEGIN
exec sp_xml_preparedocument @idoc OUTPUT, @xmlData

select MarketId, StockId, NewPrice into #PriceTable from OPENXML (@idoc, '/R/M/C',2)
WITH (
MarketId int '..[email protected]',
StockId varchar(20) [email protected]',
NewPrice decimal(38,5) [email protected]'
  )
Create Index PriceTable_M_S On #PriceTable(MarketId,StockId,NewPrice)

exec sp_xml_removedocument @idoc
上面创建了一个临时表。。

select from 视图 -- 这个视图中能访问上面那个临时表么???




  RETURN 0
END
GO


------解决方案--------------------
如果你的意思是select .. from yourview,#PriceTable where...是可以的
  相关解决方案