1
我想不出能做出一個消息條目在系統事件日誌警告使用xp_logeventxp_logevent警告條目
我想不出能做出一個消息條目在系統事件日誌警告使用xp_logeventxp_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.
你目前寫了什麼代碼? – APC 2010-03-30 06:30:12