簡體   English   中英

插入語句中的輸出子句錯誤

[英]Error with output clause in insert statement

我有點困惑為什么我的輸出子句不起作用。 我在做傻事嗎? 我不斷收到錯誤消息“輸出附近的語法不正確”。

--Create the table to insert into, with identity
create table #testtab(
    businessno int identity(1,1),
    businessname varchar(100), 
    businessref varchar(50), 
    moduser varchar(10), 
    moddate datetime, 
    modtype char(1)
);

--Insert statement with output to capture inserted id numbers
insert into #testtab (businessname, businessref, moduser, moddate, modtype) 
output inserted.businessno,inserted.businessref
values('asd','asd','asd',getdate(),'x');

這是在2008R2中。

謝謝,丹

啊...我的壞。 我實際上是從SSMS連接到SQL 2000實例的。 哎呀 看起來不像2000支持輸出。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM