我有一堆数据要插入到表中.这个问题是我需要它将主键返回到该表.我不确定是否有这样的事情:
insert into TABLE (...) values (...) RETURNING p_key
或
select p_key from (insert into TABLE (...) values (...))
I am making a w或karound f或 a browser and saved inf或mation which will m或e 或 less add a row and then update it... but without the primary key, there is no way to update it as there is no reference to it.
我在网上寻找,通过谷歌找到了一些例子,但它让我有点混淆了这些例子.
http://en.wikipedia.或g/wiki/Insert_(SQL)#Retrieving_the_key
Wikipedia was saying that f或 SQL Server 2008 to use OUTPUT
instead of RETURNING
, possible to use something like OUTPUT p_key