视图中能访问临时表么?
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 '../@v',
StockId varchar(20) '@s',
NewPrice decimal(38,5) '@p'
)
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...是可以的