分几种情况:
1、同一数据库,表已存在
insert into '表1' (name, create_time) select title, now() from '表2'
例子如下:
insert into `OPTIMIZE_CONTENT_VOD` (PARENT_ID, NAME, CREATE_TIME) select PARENT_PK, TITLE, now() from `TMP_SHIYUN_CONTENT`
注意:
可查看原文地址:
http://www.cnblogs.com/kiant71/archive/2009/05/03/1752034.html
2、同一数据库,表不存在
select name,age into ‘表1’ from ‘表2’
3、两个数据库中,拥有相同的登录名和密码
insert into 目标数据库.dbo.目标表名(name, age) select name, age from 源数据库.dbo.源表名
或
select name, age into 目标数据库.dbo.目标表名 from 源数据库.dbo.源表名
参考原文地址:http://www.cnblogs.com/yk25com/archive/2012/03/27/2419505.html