Performing POST and GET requests using CLR (C #) in SQL Server

Views: 2.282
Reading Time: 2 minutes

Hello people,
Good afternoon!

In this post I will be demonstrating to you how to perform POST and GET requests (actually it can be any type) on a SQL Server database using SQL CLR.

If you don't know what CLR is or have questions about how to use it, how to post it, etc, see this post here.

I had already made some blog posts here demonstrating how to do this using OLE Automation, but as CLR is a much safer and more flexible alternative, I decided to demonstrate how to do this using CLR (C #).

StpWs_Requisition procedure source code:

Example of use

Once the procedure has already been created and the assembly has been published to your server, simply use SP to perform your requests normally, as in the examples below:

SQL Server - Post and Get Requests with SQL CLR

Next Steps

Now that you have learned how to make requests from the database itself, you can implement the SPs below into your database, this time using the power of CLR:

The change is quite simple, just change these instructions:

for this:

Much simpler, no?
Regards and see you next post!

sql server clr integration integration post get requests requests database c # csharp sqlclr

sql server clr integration integration post get requests requests database c # csharp sqlclr