INSERT INTO area (id, code, name1, citycode) VALUES
 (1, '110101','东城区', '110100'),  --就这儿了
(2, '110102', '西城区', '110100')
INSERT INTO area (id, code, name1, citycode) 
SELECT 1, '110101','东城区', '110100'
UNION ALL
SELECT 2, '110102', '西城区', '110100'

解决方案 »

  1.   

    不是吧,为啥我的执行就没问题呢完全没有问题
    create table Area(id int,code varchar(10),name1 nvarchar(10),citycode varchar(10))
    INSERT INTO area (id, code, name1, citycode) VALUES
     (1, '110101','东城区', '110100'),
    (2, '110102', '西城区', '110100')
      

  2.   

    查询分析器只在2000里面存在,2005以后叫sqlserver Management studio,你不会是2000的吧?
      

  3.   

    我在sql2000 和 sql2005 都无法执行
      

  4.   

    只有2008及以上版本才可以这样写,其他低版本只能:
    insert into xxxx
    values()
    insert into xxxx
    values()
    insert into xxxx
    values()
      

  5.   

    方法1、贴入excel,然后拼接成一大串insert,不过我目前没现成脚本
    方法2、用select 把数据查出来再插入,1楼已经写出来了