>> 数据表复制
当表目标表存在时:
insert into 目的数据库..表 select * from 源数据库..表
当目标表不存在时:
select * into 目的数据库..表 from 源数据库..表
复制数据表结构,不复制内容
select * into 数据库名.dbo.新表名 from 数据库名.dbo.原表名 where 1=0
>> 修改数据库显示的时间
--修改前时间 select getdate() --打开高级系统控制选项 EXEC master.dbo.sp_configure 'show advanced options', 1 RECONFIGURE --修改执行权限,这样就可以执行修改时间的命令了 EXEC master.dbo.sp_configure 'xp_cmdshell', 1 RECONFIGURE --修改系统时间 exec master..xp_cmdshell 'date 2008-10-23' exec master..xp_cmdshell 'time 11:30:15' --修改后时间 select getdate() --与数据库所在计算机的时间同步 exec master.dbo.xp_cmdshell 'net time /localhost /set /Y' --同步后时间 select getdate()