Sintoma: Ao executar um script com a cláusula OPENROWSET acessando uma planilha do Excel, a seguinte mensagem de erro é apresentada: “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. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.”
Causa: O tipo de query utilizada é do tipo Ad Hoc, e o servidor deve estar configurado para permitir este tipo de execução.
Solução: Habilitar a opção na instância onde o erro acontece.
EXEC sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
EXEC sp_configure 'Ad Hoc Distributed Queries', 1;
GO
RECONFIGURE;
GO
Mais informações: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=63772
Abs!
Nenhum comentário:
Postar um comentário
Leave your comment here!