sql server 2005一次插入多条记录 sql server 2005数据库 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 2000都支持 statefrom 没空格 SQL版本都支持这种格式Insert into Table2(field1,field2,...) select value1,value2,... from Table1 'set up'as statefrom 这个地方错了吧 FROM前面需要一个空格 insert into [flow] ([chip sn],state)select [chip sn],'set yp'as state from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'格式是我贴上来的时候修改了一下,没注意。但是这个语句就是报错啊!服务器: 消息 512,级别 16,状态 1,过程 Insert_update,行 54子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。语句已终止。 确实报错啊!insert into [flow] ([chip sn],state)select [chip sn],'set yp'as state from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'提示:服务器: 消息 512,级别 16,状态 1,过程 Insert_update,行 54子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。语句已终止。 格式是复制的时候修改了,没注意。确实这样的错误服务器: 消息 512,级别 16,状态 1,过程 Insert_update,行 54子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。语句已终止。insert into [flow] ([chip sn],state)select [chip sn],'set yp'as state from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done' 根据报错信息,提示的是子查询的问题。你检查下是否还有其他语句在同时执行着,触发器...create table [ flow]( [chip sn] nvarchar(10), state nvarchar(20))create table [chip input]( [chip sn] nvarchar(10), [take over] nvarchar(20))--测试insert into [chip input] select '11','done' insert into [chip input] select '','done'insert into [ flow] ([chip sn],state)select [chip sn],'set up' as state from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'这个语句执行没有啥错误,注意以后,表和表的字段名最好不要带有空格。在MS SQL中,处理有空格的表名或者字段名,就是加"[]",这个是今天刚好注意到的问题.希望对你有所帮助! insert into [flow] ([chip sn],[state])select [chip sn],'set yp' as [state] from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'试试 这个怎么批量插入 在SQL 2005中有没有办法执行光标所在行及以下的sql语句? 现在有没有SQL Server 2005 ENT x64版下载? 一道SQL的面试题 怎么按日期把N行数据合并为一行呢 数据库查询语句,请各位帮帮忙 字符串列的求和 请教contains谓词 如何取得SQL SERVER中一个表某个字段的类型及其长段 16进制的字符串流,比如'0x01010101',怎么插入到vabinary里? 求助一句有难度的SQL语句 请问sql如何遍历子节点的值?
statefrom 没空格
insert into [flow] ([chip sn],state)
select [chip sn],'set yp'as state
from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'
格式是我贴上来的时候修改了一下,没注意。但是这个语句就是报错啊!
服务器: 消息 512,级别 16,状态 1,过程 Insert_update,行 54
子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
语句已终止。
select [chip sn],'set yp'as state
from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'
提示:
服务器: 消息 512,级别 16,状态 1,过程 Insert_update,行 54
子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
语句已终止。
确实这样的错误
服务器: 消息 512,级别 16,状态 1,过程 Insert_update,行 54
子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。
语句已终止。insert into [flow] ([chip sn],state)
select [chip sn],'set yp'as state
from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'
(
[chip sn] nvarchar(10),
state nvarchar(20))create table [chip input]
(
[chip sn] nvarchar(10),
[take over] nvarchar(20)
)
--测试
insert into [chip input] select '11','done'
insert into [chip input] select '','done'insert into [ flow] ([chip sn],state)
select [chip sn],'set up' as state from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'这个语句执行没有啥错误,注意以后,表和表的字段名最好不要带有空格。
在MS SQL中,处理有空格的表名或者字段名,就是加"[]",这个是今天刚好注意到的问题.希望对你有所帮助!
select [chip sn],'set yp' as [state]
from [chip input] where [chip sn] IS NOT NULL AND [take over] = 'done'试试