方法一

select * From [数据库链接名].master.dbo.sysdatabases where name='数据库名' and status<>512

 

方法二

DECLARE @STATUS VARCHAR(100), @linkedServerName nvarchar(128)
SET @linkedServerName = '数据库链接名';
EXEC @STATUS = sys.sp_testlinkedserver @linkedServerName
IF @STATUS=0--服务器链接正常
BEGIN
PRINT 'success'
END
ELSE
BEGIN
PRINT 'err'
END

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2021-10-18
  • 2021-08-21
  • 2021-12-28
  • 2022-12-23
  • 2021-11-18
相关资源
相似解决方案