Windows 2008 的 SMTP 寄信時若遇到 "Helo command rejected: need fully-qualified hostname" ,可做以下的修改。
The fix is easy:
/* Find Collation of SQL Server Database */
SELECT DATABASEPROPERTYEX('DBName', 'Collation')
GO
/* Find Collation of SQL Server Database Table Column */
USE sample
GO
SELECT name, collation_name
FROM sys.columns
WHERE OBJECT_ID IN (
SELECT OBJECT_ID FROM sys.objects WHERE type = 'U' AND name = 'TableName')
AND name = 'ColumnName'
HttpApplication Events:
Application_AcquireRequestState
Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request.
Application_AuthenticateRequest
Occurs when a security module has established the identity of the user.
Application_AuthorizeRequest
Occurs when a security module has verified user authorization.
Application_BeginRequest
Occurs as the first event in the HTTP pipeline chain of execution when ASP.NET responds to a request.
Application_Disposed
Adds an event handler to listen to the Disposed event on the application.
Application_EndRequest
Occurs as the last event in the HTTP pipeline chain of execution when ASP.NET responds to a request.
Application_Error
Occurs when an unhandled exception is thrown.
Application_PostAcquireRequestState
Occurs when the request state (for example, session state) that is associated with the current request has been obtained.
Application_PostAuthenticateRequest
Occurs when a security module has established the identity of the user.
Application_PostAuthorizeRequest
Occurs when the user for the current request has been authorized.
Application_PostMapRequestHandler
Occurs when ASP.NET has mapped the current request to the appropriate event handler.
Application_PostReleaseRequestState
Occurs when ASP.NET has completed executing all request event handlers and the request state data has been stored.
Application_PostRequestHandlerExecute
Occurs when the ASP.NET event handler (for example, a page or an XML Web service) finishes execution.
Application_PostResolveRequestCache
Occurs when ASP.NET bypasses execution of the current event handler and allows a caching module to serve a request from the cache.
Application_PostUpdateRequestCache
Occurs when ASP.NET completes updating caching modules and storing responses that are used to serve subsequent requests from the cache.
Application_PreRequestHandlerExecute
Occurs just before ASP.NET begins executing an event handler (for example, a page or an XML Web service).
Application_PreSendRequestContent
Occurs just before ASP.NET sends content to the client.
Application_PreSendRequestHeaders
Occurs just before ASP.NET sends HTTP headers to the client.
Application_ReleaseRequestState
Occurs after ASP.NET finishes executing all request event handlers. This event causes state modules to save the current state data.
Application_ResolveRequestCache
Occurs when ASP.NET completes an authorization event to let the caching modules serve requests from the cache, bypassing execution of the event handler (for example, a page or an XML Web service).
Application_UpdateRequestCache
Occurs when ASP.NET finishes executing an event handler in order to let caching modules store responses that will be used to serve subsequent requests from the cache.
Application_Init
This method occurs after _start and is used for initializing code.
Application_Start
As with traditional ASP, used to set up an application environment and only called when the application first starts.
Application_End
Again, like classic ASP, used to clean up variables and memory when an application ends.
Session Events:
Session_Start
As with classic ASP, this event is triggered when any new user accesses the web site.
Session_End
As with classic ASP, this event is triggered when a user's session times out or ends. Note this can be 20 mins (the default session timeout value) after the user actually leaves the site.
Profile Events:
Profile_MigrateAnonymous
Occurs when the anonymous user for a profile logs in.
Passport Events:
PassportAuthentication_OnAuthenticate
Raised during authentication. This is a Global.asax event that must be named PassportAuthentication_OnAuthenticate.
Possibly more events defined in other HttpModules like:
System.Web.Caching.OutputCacheModule
System.Web.SessionState.SessionStateModule
System.Web.Security.WindowsAuthentication
System.Web.Security.FormsAuthenticationModule
System.Web.Security.PassportAuthenticationModule
System.Web.Security.UrlAuthorizationModule
System.Web.Security.FileAuthorizationModule
System.Web.Profile.ProfileModule
if "%4" == "svn:log" exit 0
echo Property '%4' cannot be changed >&2
exit 1
刪除資料庫
DROP DATABASE name;
SQL版本查詢
SELECT SERVERPROPERTY('productversion')
SELECT SERVERPROPERTY ('productlevel')
SELECT SERVERPROPERTY ('edition')
with(nolock, index(IX_NTA_StayingRoomSales))
Select * From Table with(nolock, index(IX_NTA_StayingRoomSales)) Where AAAAA
Principal(來源), Mirror(鏡像), Witness(見證,非必要,系統出現錯誤時,自動切換資料庫)
上方三個資料庫需使用相同版本
/*查資料庫版本號*/
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'),SERVERPROPERTY ('edition')
參考資料:
MS SQL Server 2008_容錯轉移_資料庫鏡像實作
Simple Step by Step Database Mirroring
SQL Server 2008 的執行個體之間傳送登入和密碼
Troubleshooting Database Mirroring Error 1418
Microsoft SQL 2008 SERVER -- Fix : Error: 1418 Mirroring
/*
DB: Principal
Step 1, 備份來源資料庫
*/
backup database reikoTest to disk='D:\MirrorTEST_Full.bak'
with format
go
backup log reikoTest to disk='D:\MirrorTEST_log.bak'
go
/*
DB: Mirror
Step 2, 建立mirror資料庫
*/
Create database ReikoTEST
go
restore database ReikoTEST from disk='D:\MirrorTEST_Full.bak'
with replace, norecovery
go
restore log ReikoTESt from disk='D:\MirrorTEST_log.bak'
with norecovery
go
/*
DB: Principal
Step 3, 建立SQL Server 2008 的執行個體之間傳送登入和密碼
注意 這個指令碼會在 master 資料庫中建立兩個預存程序。這兩個預存程序名為 sp_hexadecimal 預存程序和 sp_help_revlogin 預存程序。
※第一次建立mirror時(預存程序不存在時),才需執行本指令
*/
SQL指令碼
/*
DB: Principal
Step 4, 查詢傳送登入帳號和密碼
sp_help_revlogin 預存程序所產生的輸出指令碼是登入指令碼。這個登入指令碼會建立具有原始「安全性識別碼」(SID) 和原始密碼的登入。
*/
EXEC sp_help_revlogin
/*
執行後,複製要使用的帳號,至mirror資料庫執行
ex.
-- Login:reiko
CREATE LOGIN [reiko] WITH PASSWORD = 0x010036D88E850F3F29E70120CB4CD2DEE7CBAD1AB83AA4A6A927 HASHED, SID = 0x495A943A23B12C48A43C39776B879A49, DEFAULT_DATABASE = [master], CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF
*/
/*
DB: Mirror
Step 5, 建立傳送登入帳號和密碼
刪掉DEFAULT_DATABASE = [master],(上方紅字部份)
ex.
-- Login:reiko
CREATE LOGIN [reiko] WITH PASSWORD = 0x010036D88E850F3F29E70120CB4CD2DEE7CBAD1AB83AA4A6A927 HASHED, SID = 0x495A943A23B12C48A43C39776B879A49, CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF
*/
-- Login:reiko
CREATE LOGIN [reiko] WITH PASSWORD = 0x010036D88E850F3F29E70120CB4CD2DEE7CBAD1AB83AA4A6A927 HASHED, SID = 0x495A943A23B12C48A43C39776B879A49, CHECK_POLICY = OFF, CHECK_EXPIRATION = OFF