IT

임시 분산 쿼리를 활성화하는 방법

lottoking 2020. 8. 26. 08:08
반응형

임시 분산 쿼리를 활성화하는 방법


OPENROWSETSQL Server 2000에서 쿼리를 실행 하면 작동합니다.

그러나 SQL Server 2008의 동일한 쿼리는 다음 오류를 생성합니다.

이 구성 요소 가이 서버에 대한 보안 구성의 일부로 해제되어 있기 때문에 SQL Server에서 구성 요소 'Ad Hoc Distributed Queries'의 'OpenRowset / OpenDatasource'에 대한 액세스를 차단했습니다. 시스템 관리자는 sp_configure 를 사용하여 'Ad Hoc Distributed Queries' 사용을 활성화 할 수 있습니다.


다음 명령이 도움이 될 수 있습니다 ..

EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE
GO

다음 명령을 확인할 수 있습니다.

sp_configure 'show advanced options', 1;
RECONFIGURE;
GO  --Added        
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO

SELECT a.*
FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',
     'SELECT GroupName, Name, DepartmentID
      FROM AdventureWorks2012.HumanResources.Department
      ORDER BY GroupName, Name') AS a;
GO

또는이 문서 링크


sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO

시스템 카탈로그에 대한 임시 업데이트가 "지원되지 않음"이거나 "Msg 5808"이 표시되는 경우 다음과 같이 재정의로 구성해야합니다.

EXEC sp_configure 'show advanced options', 1
RECONFIGURE with override
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE with override
GO

참고 URL : https://stackoverflow.com/questions/14544221/how-to-enable-ad-hoc-distributed-queries

반응형