Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: Active Cluster Node for SQL Server

    I created this sproc and run it from the agent every 5 min.

     

    CREATE PROCEDURE CheckCurrentNode

    AS

    BEGIN

     

     SET  NOCOUNT   ON

     

     DECLARE  @ServiceName  VarChar(255)

     DECLARE  @HostName  VarChar(255)

     DECLARE  @OldHostName  VarChar(255)

     DECLARE  @Date   DateTime

     DECLARE  @Subject  VarChar(2000)

     DECLARE  @Msg   VarChar(8000)

     SET  @Date   = GetDate()

     

     

     select Distinct @ServiceName = @@SERVICENAME, @HostName = HostName from sysprocesses

     where hostname in ('NODE1','NODE2')                                                                                                                      

     

     -- CREATE TABLE...

Viewing post 1 (of 1 total)