Como habilitar consultas distribuídas ad hoc no SQL Server 2008 R2

1

Quando executo uma consulta com o OPENROWSET no SQL Server 2000, ele funciona.

Mas a mesma consulta no SQL Server 2008 gera o seguinte erro:

SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure

eu tento rodar

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

No entanto, qualquer tentativa de executar RECONFIGURE gera o erro:

Msg 5808, Level 16, State 1, Line 1
Ad hoc update to system catalogs is not supported.

Como faço para ativar consultas distribuídas ad hoc no SQL Server 2008 R2?

Observação : Microsoft SQL Server 2008 R2 (SP1) - 10.50.2550.0 (X64) 11 de junho de 2012 16:41:53 Copyright (c) Microsoft Corporation Standard Edition (64 bits) no Windows NT 6.1 (compilação 7601: Service Pack 1) (hipervisor)

    
por Ian Boyd 05.03.2013 / 15:40

1 resposta

4

daqui: link

Execute este primeiro:

EXEC sp_configure ‘allow updates’, 0
RECONFIGURE

ou altere suas declarações RECONFIGURE para RECONFIGURE WITH OVERRIDE :

EXEC sp_configure 'show advanced options', 1
RECONFIGURE WITH OVERRIDE --really reconfigure
GO
EXEC sp_configure 'ad hoc distributed queries', 1
RECONFIGURE WITH OVERRIDE --really reconfigure
GO
    
por 05.03.2013 / 15:47