Consultor Eletrônico



Kbase 47557: Erro de permissão na procedure xp_cmdshell na mídia do Datasul 11 SQLServer
Autor   Henrique Antonio Eger - CAT
Acesso   Público
Publicação   11/22/2012
Sintoma:
Ao executar o geranciador de scripts na mídia SQLServer, é apresentada a mensagem de erro abaixo

Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', search for 'xp_cmdshell' in SQL Server Books Online.

Solução:
Antes de executar os scripts de banco disponíveis na mídia, será necessário executar o comando abaixo no SQL:

-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO

Fonte: http://msdn.microsoft.com/en-us/library/ms190693.aspx