易截截图软件、单文件、免安装、纯绿色、仅160KB

求SQL语句 - MS-SQL Server / 基础类

table1 
 id  
 01 
 02
...
table2 

 id registerdate
 01 2010-02-27 22:49:26.633

 02 2010-02-27 22:56:23.070

...
在table1中新增regdate 列
并把registerdate列的值插入 regdate列中





SQL code:
--truncate table table1 --删除table1

select *
into table1
from table2



这样是不是更快?


SQL code:

alter table table1 add regdate datetime
update table1 set regdate=registerdate from table2 where table2.id=table1.id


SQL code:
exec ('alter table table1 add regdate datetime')
exec ('update table1 set regdate=registerdate from table2 where table2.id=table1.id')


引用
SQL code
--truncate table table1 --删除table1

select *
into table1
from table2



这样是不是更快?

还有很多列没些出来的。。。

SQL code



Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/



相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

jsp链接sql2000的疑问?



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

sql小小的疑问 - .NET技术 / C#

可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......

MS SQL作业问题 - MS-SQL Server / 应用实例

如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP

参考:http://hi.baidu.com/toiota ......

Access通过Sql语句创建数据库 - .NET技术 / C#

在Access的查询中执行下面的语句,无效,提示期待select ,updata ,...
CreateTble C=Answer N="回帖表"
(
  C=ID T="INTEGER" P=No M=No N="编号" Z=false,
  C=Ques ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号