Sql Server 数据库Insert Into ***Select ***From ****使用说明
2007-11-04 23:45
543 查看
如下例子:
Insert Into NewsOnline(Fenlei,ZuanTi,Title,Content,Hits,EnterDate,Leton) Select Fenlei,ZuanTi,Title,Content,Hits,EnterDate,Leton From Ok
在使用这个语句的时候一定要确定Fenlei,ZuanTi,Title,Content,Hits,EnterDate,Leton字段,两个数据库表是相同结构的,什么意思?意思就是,就是假如Fenlei是Int类型的,那NewsOnline和Ok表的Fenlei必须是Int类型,若Title是varchar(100),在NewsOnline和Ok表的Title字段也必须是Varchar类型,而且长度必须也是相同的,否则执行会不通过。
Ps:发现这个语句在数据移动中挺好用的,呵呵
Insert Into NewsOnline(Fenlei,ZuanTi,Title,Content,Hits,EnterDate,Leton) Select Fenlei,ZuanTi,Title,Content,Hits,EnterDate,Leton From Ok
在使用这个语句的时候一定要确定Fenlei,ZuanTi,Title,Content,Hits,EnterDate,Leton字段,两个数据库表是相同结构的,什么意思?意思就是,就是假如Fenlei是Int类型的,那NewsOnline和Ok表的Fenlei必须是Int类型,若Title是varchar(100),在NewsOnline和Ok表的Title字段也必须是Varchar类型,而且长度必须也是相同的,否则执行会不通过。
Ps:发现这个语句在数据移动中挺好用的,呵呵
相关文章推荐
- 数据库_MySQL_mysql中insert into select from的使用
- 【数据库】select into from 与 insert into select
- select into 与 insert into select 使用说明
- mysql中insert into select from的使用
- 【SQL】数据库中select into from 和 insert into select的区别
- SQL Server 2005 导出包含(insert into)数据的SQL脚本 (使用存储过程) 分类: 数据库
- mysql中insert into select from的使用
- select into from 和 insert into select 的区别和使用
- sql 数据库插入select into from 和 insert into select from
- 数据库中select into from 和 insert into select的区别
- SQL SERVER – Insert Data From One Table to Another Table – INSERT INTO SELECT – SELECT INTO TABLE
- mysql中insert into select from的使用
- select into from 与 insert into select 使用方法
- mysql中insert into select from的使用
- elect into from和insert into select from两种表复制语句区别
- Hibernate hql: 只支持用法 INSERT INTO ... SELECT ... FROM
- INSERT INTO .. SELECT ... FROM DUAL WHERE.插入数据前判断表中是否已经存在
- select into from 提示 Undeclared variable.....错误的解决办法 && select into from 和 insert into select 的用法和区别
- Insert Into ...Select 加 Update From 同步表数据
- 语法:MySQL中INSERT INTO SELECT的使用