我对SQL Server数据库中的SQL查询nextval有问题:
无法绑定多部分标识符“ applicationauth.nextvalue”。
有什么主意吗?
这是查询:
insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid)
select 'AUTOSCRIPT', 'ATTRVAL', 'ATTRVALUECON', varvalue, applicationauth.nextvalue
from maxvars
where varname = 'ALLUSERGROUP';
insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid)
select 'AUTOSCRIPT', 'HIDEATTR', 'HIDEATTRCON', varvalue, applicationauthseq.nextval
insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid)
select 'AUTOSCRIPT', 'ATTRVAL', 'ATTRVALUECON', varvalue, applicationauthseq.nextval
from maxvars
where varname = 'ALLUSERGROUP';
insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid)
select 'AUTOSCRIPT', 'HIDEATTR','HIDEATTRCON', varvalue, applicationauthseq.nextval
from maxvars
where varname = 'ALLUSERGROUP';
insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid)
select 'AUTOSCRIPT', 'HIDEBUT', 'HIDEBUTCON', varvalue, applicationauthseq.nextval
from maxvars
where varname = 'ALLUSERGROUP';
insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid)
select 'AUTOSCRIPT', 'HIDEIMP', 'HIDEIMPCON', varvalue, applicationauthseq.nextval
from maxvars
where varname = 'ALLUSERGROUP';
(依此类推等等)
我收到以下错误消息:
消息4104,第16级,状态1,第2行
多部分标识符“ applicationauth.nextvalue”无法绑定。Msg 4104,第16级,状态1,第9行
无法绑定多部分标识符“ applicationauthseq.nextval”。(....依此类推)
答案 0 :(得分:2)
这是您要找的吗?
将init.gradle
替换为applicationauthseq.nextval
。
不确定初始语法在哪里,但是NEXT VALUE FOR
是如何从T-SQL调用SEQUENCE
对象。