sql server 获取Error信息
SQL Server产生的Log通常存放在 C:\\Program Files\Microsoft SQL Server\MSSQL.xx\MSSQL\LOG\ERRORLOG和ERRORLOG.xx 文件中,log文件中有大量的信息或错误。查阅ERROR.LOG很耗时耗力,特别是有多个SQL Server安装。
使用存储过程来查看,相对比较方便
EXEC master..xp_readerrorlog
--结果
LogDate ProcessInfo Text
2016-03-23 18:52:15.380 Server Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: ) (Hypervisor)
2016-03-23 18:52:15.380 Server (c) Microsoft Corporation.
2016-03-23 18:52:15.380 Server All rights reserved.
2016-03-23 18:52:15.380 Server Server process ID is 3888.
2016-03-23 18:52:15.380 Server System Manufacturer: 'VMware, Inc.', System Model: 'VMware Virtual Platform'.
2016-03-23 18:52:15.380 Server Authentication mode is MIXED.
...
谢谢
定,精,简,俭