• Sean Pearce (8/22/2014)


    Using RAISERROR with a severity level of 20 will disconnect the session immediately.

    IF (@@SERVERNAME='Prod')

    BEGIN

    RAISERROR('Incorrect Server', 20, -1) WITH LOG;

    END;

    GO

    Thanks