Skip to main content

Questions tagged [ole-automation]

OLE Automation Procedures (i.e. sp_OA*) is a feature of Microsoft SQL Server that allows for calling OLE Automation objects and COM-visible code from within T-SQL batches.

Filter by
Sorted by
Tagged with
2 votes
0 answers
190 views

sp_OACreate script returns Null value from API fetch? The API works well in a html file

I am trying to create a script in Microsoft SQL Server Management Studio to fetch the current exchange rate from an API and update a database. I am told it is not posisble and common to do this. -- ...
Luis Avalos's user avatar
-2 votes
1 answer
292 views

Huge PREEMPTIVE_OS_GETPROCADDRESS Waits From sp_OAMethod. How to debug?

Some queries are hitting my CPU extremely hard. sp_WhoIsActive reports that sp_OAMethod is the cause (the sql_text column points to it) and that it has of huge waits of the ...
J. Mini's user avatar
  • 533
2 votes
1 answer
5k views

What is the best way to export/extract varbinary images in a SQL Server database to flat file via t sql, anything better than sp_OA methods?

I've been tasked to extract images saved in SQL Server (as varbinary) to flat files via t-sql. I haven't done ETL work for over a decade and I can't recall any other method of doing this via t-sql ...
Eric Swiggum's user avatar
5 votes
3 answers
5k views

What's an example of an exploitation of the security from enabling Ole Automation Procedures Server Configuration option?

I have a need to enable to the Ole Automation Procedures Server Configuration Option on my SQL Server, but was wondering what specific kind of security risks do I incur by doing so? What is an ...
J.D.'s user avatar
  • 38.3k
0 votes
2 answers
55 views

Looking for recommendation [closed]

I am a non IT background, my recent projects uses PowerShell for a lot of SQL Server administration. I would like to start from absolute zero, and learn to use and code the Windows PowerShell as it ...
Goshu's user avatar
  • 13
6 votes
1 answer
5k views

When did sp_OACreate et. al. become deprecated?

I had an issue on an instance of SQL Server I'm supporting and many of the Stack sites have information on the sp_OA* stored procedures, but most of them basically say "Don't use those; they are ...
akousmata's user avatar
  • 163
0 votes
1 answer
4k views

Calling a web service from T-SQL (Stored Procedure) using MSXML [closed]

EXEC @hResult = sp_OAMethod @objectID, 'send', null, @requestBody IF @hResult <> 0 BEGIN EXEC sp_OAGetErrorInfo @objectID, @source OUT, @desc OUT SELECT ...
Alfaiz Ahmed's user avatar
2 votes
2 answers
3k views

Export a table and zip with password

I would like, from TSQL, to use a view to extract data from a table, output it with BCP, then use non 3rd party tools to ZIP it with a password and AES encryption. Optionnally, I could use a 3rd party ...
Philippe's user avatar
  • 507
1 vote
1 answer
2k views

Why do I see sp_OACreate, sp_OASetProperty in sp_WhoIsActive?

I've seen this happen a few times: sp_WhoIsActive shows various sp_OA% sprocs, with my user name, but I'm certainly not running them directly. Does this reflect some kind of query rewrite process? ...
Jon of All Trades's user avatar
6 votes
2 answers
2k views

Can I call SMO from pure T-SQL?

I know how to script a stored procedure using PowerShell and SMO: [System.reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | out-null [System.Reflection.Assembly]::...
bernd_k's user avatar
  • 12.3k