0
我需要獲取表名作爲輸出,下面是示例代碼。使用存儲過程作爲輸出的SQL顯示錶
eg. set @table = [dbo].[mytable]
Insert into <table 1> (a, b, c, d as table name, i)
select a, b , c, '[email protected]+' , i from <table 2>
inner join <table2> on a = tmp.a `
在INSERT語句中,我需要列d擁有適用於所有記錄的表名。我收到一個錯誤「多部分不能被綁定」是否有一種特殊的方式來調用表名稱來顯示唯一的目的?
謝謝!
你的樣品查詢根本沒有意義。什麼是'tmp'?爲什麼自我加入? –