我嘗試在單引號內創建一個臨時表,它顯示錯誤,它不能識別表 #newtable
...它只支持##table
(全局臨時表),但我不想一個全球臨時表,我只是想要解釋它的背後原因是什麼。如何在單引號內創建臨時表
'select coulumn1, column2, column3, ##newtable.columnid as ShipProfile,
ROW_NUMBER() over (order by Id)as ''RowNumber''
into ##TempProduct
from Product
left join ##newtable on Product.columnId=##newtable.ColumnId
where MerchantId='+CONVERT(varchar(20),@MerchatID)
你是怎麼執行這個的?你說你沒有使用全局臨時表,但是在代碼中它們是用##定義的。 – SWeko
我正在使用全球可溫度,而不是#temptable,我的問題是爲什麼我不能使用單引號內的#temptable – Thiyagarajan