查看 SQL Server 错误日志 (SQL Server Management Studio)View the SQL Server error log (SQL Server Management Studio)

适用对象:是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

SQL ServerSQL Server 错误日志包含用户定义的事件和某些可用于故障排除的系统事件。The SQL ServerSQL Server error log contains user-defined events and certain system events you can use for troubleshooting.

查看日志View the logs

  1. 在 SQL Server Management Studio 中选择“对象资源管理器” 。In SQL Server Management Studio, select Object Explorer. 按 F8 打开“对象资源管理器” 。To open Object Explorer, select F8. 或者,在顶部菜单上选择“视图”,然后选择“对象资源管理器” :Or on the top menu, select View, and then select Object Explorer:

    Object_explorer

  2. 在“对象资源管理器” 中,连接到某个 SQL Server 实例,然后展开该实例。In Object Explorer, connect to an instance of SQL Server, and then expand that instance.

  3. 找到并展开“管理” 部分(假设你有权查看它)。Find and expand the Management section (assuming you have permissions to see it).

  4. 右键单击“SQL Server 日志”,选择“查看”,然后选择“SQL Server 日志” 。Right-click SQL Server Logs, select View, and then choose SQL Server Log.

    View_SQLServer_Log_SSMS

  5. 将显示“日志文件查看器” (可能需要等一段时间),其中包含可供查看的一个日志列表。The Log File Viewer appears (it might take a moment) with a list of logs for you to view.

另请参阅See also

有关详细信息,请参阅 MSSQLTips.com 上的实用帖确定 SQL Server 错误日志文件的位置For more information, see MSSQLTips.com's helpful post Identify location of the SQL Server Error Log file.