2.对TABLE2设立主键约束..这样就不会插入重复的
这样试试
insert into table1(bh,dm)
select (bh,dm) from table12 where bh not in (select hb from table1)3.select table2.*,char(10) dd,0 as ee
select * from table2
这样试试
insert into table1(bh,dm)
select (bh,dm) from table12 where bh not in (select hb from table1)3.select table2.*,char(10) dd,0 as ee
select * from table2
2.
insert table1(bh,dm) select (bh,dm) from table12 where bh not in (select bh from table1) 3.
select *,1 列名1,' ' 列名2 into table2 from table1
insert into table1(bh,dm) select (bh,dm) from table12 where bh not in (select bh from table1)
2,select *,cast('' as char(10)) as dd ,cast(NULL as int) as EE into table2 from table1
insert abcd select * from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="c:\报表";User ID=Admin;Password=;Extended properties=dBase 5.0')...fh200303
2.
insert into table1(bh,dm) select (bh,dm) from table12 where bh not in (select bh from table1)3.select bh,dm,'dddddddddd' as dd,1 as ee into table2 from table1
可以直接用导入/导出向导
或在查询分析器中用:
insert 表名 select * from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="c:\报表";User ID=Admin;Password=;Extended properties=dBase 5.0')...tb2.
insert into table1(bh,dm) select distinct * from (select * from table1 union select * from table12) a3.
select *,cast('' as char(10)) as dd,cast(0 as int) as ee into table2 from table1
2. To :zjcxc(邹建)虽然我很崇拜你。但这个你马虎了,呵呵。 是不是先
insert into #temp1(bh,dm)select * from (select * from table1 union select * from table12)a
truncate table table1
insert into table1 select * from #temp1让邹建,大力蚂蚁等高手来玩这个真的有点.原子弹炸鸡蛋.哈哈。