SQL Server blocked access to procedure ‘sys.sp_OACreate’ of component ‘Ole Automation Procedures’ because this component is turned of as a part of security configuration for this server. – How to resolve this issue?

You are receiving this error because your SQL Server is not allowing OLE Automation objects to be instantiated within Transact-SQL batches and your code/application is trying to use this feature. Security feature of SQL Server automatically disable OLE Automation Procedures by design. Hence to allow this feature, execute below code on the server:


sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO

sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO


When OLE Automation Procedures are enabled, a call to sp_OACreate will start the OLE shared execution environment and your application/code will start working. However please be advised that enabling ‘Ole Automation Procedures’ is a security risk. Hence you/your developers should use CLR instead of Ole.

Comments