惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
小众软件
小众软件
The Cloudflare Blog
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
美团技术团队
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
博客园 - 叶小钗
月光博客
月光博客
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
Y
Y Combinator Blog
D
Docker
Microsoft Azure Blog
Microsoft Azure Blog

博客园 - Notus|南色的风

asp.net用url重写URLReWriter实现任意二级域名(续) selenium cant start a new browser(ie7):java.lang.StringIndexOutOfBoundsException: String index out of range: -1 conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. java移动/复制文件 copy/move file eclipse输出jar的利器 java调用c#写的webservice java的Date.getTime()转换成C#的Datetime.ticks - Notus|南色的风 - 博客园 我的新博客 关于小凡 关于迷笛音乐节的重大通知-_- 给我一点自由...... 4月份的歌 都说了,一切都会过去 everything Will Flow Take It Away song2 【Ireland On-Line】霍利尔:裁判毁了枪手 【每日邮报】利物浦对阵阿森纳能走出牢狱要谢天谢地谢Peter Turn into
修改sql server2005的系统时间
Notus|南色的风 · 2008-09-09 · via 博客园 - Notus|南色的风

多说一句,以前我一直以为sql server里的时间和sql server所在计算机的时间是一致的,直到一个小时前才发现不是这样的... 

--修改前时间 print 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 19:40:00' 

--修改后时间 print getdate() 

--与数据库所在计算机的时间同步 exec master.dbo.xp_cmdshell 'net time \\. /set /y' 

--同步后时间 print getdate() 

要主意,修改系统时间的时候,会连sql server所在计算机的时间一起修改了,所以如果想要变回准确的时间,需要先用计算机的时间同步更新功能更新一下时间,然后在把sql server的时间和计算机时间同步. 但反过来,如果用双击时间出现的"日期和时间属性面板"中修改了计算机时间,是不会修改到sql server时间的