我不能使用能够xp_logevent

使一个消息条目在系统事件日志的警告

没有正确的解决方案

其他提示

这里是在 xp_logevent(的Transact-SQL)的文档

当我跑这个例子中(从SQL Server 2005企业上述文档Windows Server 2003企业上):

--I'm not sure why they declare their local variables with @@, but this code is right from the documentation
DECLARE @@TABNAME varchar(30)
DECLARE @@USERNAME varchar(30)
DECLARE @@MESSAGE varchar(255)
SET @@TABNAME = 'customers'
SET @@USERNAME = USER_NAME()
SELECT @@MESSAGE = 'The table ' + @@TABNAME + ' is not owned by the user 
   ' + @@USERNAME + '.'

USE master
EXEC xp_logevent 60000, @@MESSAGE, informational

有在系统日志中的消息:

Type: Informational
Source: MSSQLSERVER
Category: (2)
Event: 17061
User: N/A
Description: Error: 60000 Severity: 10 State: 1 The table customers is not owned by the user dbo.
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top