如何通过SQL语句修改系统日期和时间

首先需要开启SQL Server的cmdshell组件.

然后

修改日期 exec  xp_cmdshell   'date   2000-10-18'    日期格式需要与服务器设置一致,可通过xp_cmdshell   'date' 查看

修改时间  exec  xp_cmdshell   'time   10:18:23.00'    时间格式需要与服务器设置一致,可通过xp_cmdshell   'time' 查看

你可能感兴趣的:(数据库,sql,server)