-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------------ Microsoft SQL Server 2012 - 11.0.5343.0 (X64) May 4 2015 19:11:32 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 10240: ) (Hypervisor)
c:\Windows\Microsoft.NET\Framework\v4.0.30319 $ csc Microsoft (R) Visual C# Compiler version 4.6.0079.0 for C# 5 Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
OS Name: Microsoft Windows Server 2012 R2 Standard OS Version: 6.3.9600 N/A Build 9600 OS Manufacturer: Microsoft Corporation OS Configuration: Member Server OS Build Type: Multiprocessor Free System Model: VMware Virtual Platform System Type: x64-based PC Processor(s): 2 Processor(s) Installed. BIOS Version: Phoenix Technologies LTD 6.00, 4/14/2014 Total Physical Memory: 4,096 MB Virtual Memory: Max Size: 4,800 MB Virtual Memory: Available: 2,497 MB Virtual Memory: In Use: 2,303 MB
C:\>sqlcmd -Q "SELECT @@VERSION"
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------------ Microsoft SQL Server 2012 - 11.0.5058.0 (X64) May 14 2014 18:34:29 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hype rvisor)
-- 查看:Database Mail 處理的所有訊息 SELECT * FROM msdb.dbo.sysmail_allitems GO -- 查看:傳送成功的訊息時 SELECT * FROM msdb.dbo.sysmail_sentitems GO -- 查看:哪些訊息未成功傳送 SELECT * FROM msdb.dbo.sysmail_faileditems GO -- 查看:未傳送或正在重試狀態的 Database Mail 訊息 SELECT * FROM msdb.dbo.sysmail_faileditems GO -- 查看:Database Mail 系統傳回的錯誤訊息之類 SELECT * FROM msdb.dbo.sysmail_event_log GO -- 查看:Database Mail 附加檔案的相關資訊 SELECT * FROM msdb.dbo.sysmail_mailattachments GO
-- 發送郵件的狀態 SELECT last_mod_date, CASE sent_status WHEN1THEN'Sent Successfully' WHEN2THEN'Failed' WHEN3THEN'Unsent' END sent_status, [subject], recipients FROM msdb.dbo.sysmail_mailitems ORDERBY last_mod_date DESC
-- 發送失敗的郵件與錯誤訊息 SELECT profile_id, items.last_mod_date, items.[subject], l.[description] ErrorMessage, items.sent_status, recipients FROM msdb.dbo.sysmail_faileditems AS items INNERJOIN msdb.dbo.sysmail_event_log AS l ON items.mailitem_id = l.mailitem_id ORDERBY last_mod_date DESC