26
Aug

作者:邹建
原文转自:http://topic.csdn.net/t/20030725/20/2072910.html

–数据测试:

–创建数据测试环境
declare   @TableA   table(id   int,in1   varchar(5),out1   varchar(5))
insert   into   @tablea(id,in1,out1)
select   1,’08:00′,’12:00′
union   all   select   2,’08:00′,’12:00′
union   all   select   3,’08:00′,’12:00′
union   all   select   4,’08:00′,’12:00′
union   all   select   5,’08:00′,’12:00′

–更新表
update   @tablea   set
in1=left(in1,3)+right(100+cast(floor(rand(id)*100000)   as   int)   %   60,2)
,out1=left(out1,3)+right(100+cast(floor(rand(id)*100000)   as   int)   %   60,2)

–显示结果
select   *   from   @tablea

–测试的数据结果
id                     in1       out1
———–   —–   —–
1                       08:19   12:19
2                       08:21   12:21
3                       08:22   12:22
4                       08:24   12:24
5                       08:26   12:26

This entry was posted on Tuesday, August 26th, 2008 at 8:44 pm and is filed under 数据库. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or TrackBack URI from your own site.

Leave a reply

Name (*)
Mail (*)
URI
Comment