Can linked server be disabled?

  • hI,

    I wanted to know if we can disable linked servers for some scheduled time duration..

    If yes, then how.

    Thanks.

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • You could set up a job to disable data access and the enable it back.

    -- Disable data access

    EXEC sp_serveroption @server = 'linked_server_name'

    ,@optname = 'data access'

    ,@optvalue = '0'

    -- Enable data access

    EXEC sp_serveroption @server = 'linked_server_name'

    ,@optname = 'data access'

    ,@optvalue = '1'

    -- Gianluca Sartori

  • I tried to do that, It threw an error:-

    Msg 15600, Level 15, State 1, Procedure sp_serveroption, Line 177

    An invalid parameter or option was specified for procedure 'sys.sp_serveroption'.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • My bad, the parameter had to be passed in as boolean...

    -- Disable data access

    EXEC sp_serveroption @server = 'linked_server_name'

    ,@optname = 'data access'

    ,@optvalue = 'false'

    -- Enable data access

    EXEC sp_serveroption @server = 'linked_server_name'

    ,@optname = 'data access'

    ,@optvalue = 'true'

    -- Gianluca Sartori

  • @ Gianluca

    Thanks a lot.

    Regards,

    Sushant

    DBA

    West Indies.

    Regards
    Sushant Kumar
    MCTS,MCP

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply