User-1330468790 posted
Hi jagjit saini,
Could you please confirm that you have enabled OLE Automation procedures?
To prevent SQL Server to throw an exception, it is better to check first if advanced options is enabled at SQL Server configuration by calling sp_configure system procedure.
The following example shows how to view the current setting of OLE Automation procedures.
EXEC sp_configure 'Ole Automation Procedures';
GO
The following example shows how to enable OLE Automation procedures.
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'Ole Automation Procedures', 1;
GO
RECONFIGURE;
GO
Related link:
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option?redirectedfrom=MSDN&view=sql-server-ver15
Hope helps.
Best regards,
Sean