insert的奇怪问题 这么插入是可以的,但是上一句select top 10 * into b from a就已经出错了。执行select * from sysobjects where name = 'b'查查 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select top 10 * into b from a没有问题阿,已经生成了10行记录的表b了,但是再执行insert into b select * from a 就不行了 那就可能是你的主键重复的原因!因为你在插入表A之前已经插入了表A的前十条数据!try:select top 10 * into b from adelete from b然后 insert into b select * from a sorry,更正前面的回答:try:drop table bselect top 10 * into b from a然后 insert into b select * from a select top 10 * into b from a用A表的前10行记录生成B表,insert into b select * from a 把A表的全部数据移到B表.你到底要做什么啊 我修改如下:select top 10 * into b from a insert into b select * from a where a.name not in (select name from b) 执行:说b表已存在! 我不想删除,只是想每天更新添加数据 怎样把两个不同数据库里的表对比? 得出库存台帐中上期结转的数据 级联删除? 求助!!!sqlserver2000数据转到sqlserver7.0要怎么实现啊?? 求SQL语句! 关于查询层级问题 SQL有错误,如何修改! 日期类型转换 请问各位sql有bool类型吗? 这样的问题各位都是怎么处理的 求救:SQL Server 2000在运行SQL Server Agent时,提示登录失败,无法启动服务 如何用存储过程获取连接特定数据库的当前连接数?
没有问题阿,已经生成了10行记录的表b了,但是再执行
insert into b select * from a 就不行了
因为你在插入表A之前已经插入了表A的前十条数据!try:
select top 10 * into b from a
delete from b
然后 insert into b select * from a
try:drop table b
select top 10 * into b from a
然后 insert into b select * from a
用A表的前10行记录生成B表,
insert into b select * from a
把A表的全部数据移到B表.
你到底要做什么啊
where a.name not in (select name from b)
执行:说b表已存在!
我不想删除,只是想每天更新添加数据