MadeiraData/ClrHttpRequest

Cannot find either column "dbo" or the user-defined function or aggregate "dbo.clr_http_request", or the name is ambiguous.

francesco1119 opened this issue ยท 5 comments

I freshly installed your SQLCLR script and I was looking for testing it.

In your Use Cases page I tried the Stack Overflow API query but it returns me:

Msg 4121, Level 16, State 1, Line 2
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.clr_http_request", or the name is ambiguous.

I changed [dbo].[clr_http_request] to [dbo].[ClrHttpRequest] and tried to delete [dbo] but no joy

That must mean that you're simply connected to the wrong database.

You can run the following command to print out the database name you're currently in:

SELECT DB_NAME()

To change the database context to the correct one, you'll need the USE command:

USE [YourDBName]

Or, assuming you're in SSMS, simply change the database context from the dropdown menu:

When I point to ClrHttpRequest it returns me this error:

Nope

Msg 6522, Level 16, State 1, Line 2
A .NET Framework error occurred during execution of user-defined routine or aggregate "clr_http_request": 
System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
System.Data.SqlTypes.SqlNullValueException: 
   at System.Data.SqlTypes.SqlString.get_Value()
   at UserDefinedFunctions.clr_http_request(SqlString requestMethod, SqlString url, SqlString parameters, SqlString headers, SqlInt32 timeout, SqlBoolean autoDecompress, SqlBoolean convertResponseToBas64)
.

With any other database:

Nope2

Msg 4121, Level 16, State 1, Line 2
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.clr_http_request", or the name is ambiguous.

@francesco1119 , the version you're using is an outdated one which doesn't support NULL parameters.

Please download the latest release which I've just created a few hours ago:
https://github.com/MadeiraData/ClrHttpRequest/releases/tag/v3.0.0

I think it should resolve your issue (it works on my machine).

This worked!

I voted your proposition on the Azure Feedback Portal, I believe SSMS should have some sort of tool like this that works out of the box.

I will try to port this on Azure Cloud to see if it works.

That was Eilert's proposition, not mine, but thanks anyway! ๐Ÿ˜…

Oh and by the way, there's currently no support for CLR on Azure SQL DB (if that's what you meant by "Azure Cloud").
And as far as I know, UNSAFE assemblies are not supported with Azure SQL Managed Instances.

So, in regards to Azure, your only option to use this CLR assembly is on a Virtual Machine.