分幾種情況:
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