Enabling OLE Automation via T-SQL on SQL Server

Views: 2.365
Reading Time: <1 minute

Staff,
Good evening.

Today I will teach you how to enable OLE Automation features in SQL Server. For those unfamiliar with this feature, it allows the DBA or Developer to perform a series of actions on the database using OLE DB, such as read / write / move / copy / delete files, Excel spreadsheet creation and more stuff. The syntax is somewhat similar to VBA and uses the Windows API for these operations.

However, DBA, keep in mind that this can be a very useful and powerful tool for IT staff, but at the same time, a major risk to your database security, as users who will have access to these resources will be able to , for example, undetectably viewing or removing files from the database server itself or even from other machines on the network.

To enable this feature, we use the following commands:

Learn more:

That's it folks!
Soon I will post a post with some cool functions using OLE Automation. (Edit: Access the created post)