1,020 questions
3
votes
1
answer
906
views
How To Match UDT T-SQL AND C# CLR Types?
Unsure if this question makes sense but I'm new to CLR/UDT and just finished following through this example here:
https://learn.microsoft.com/en-us/sql/relational-databases/clr-integration/database-...
0
votes
2
answers
490
views
How to register PdfSharp for SQL CLR in SQL Server 2014?
I have a CLR stored procedure that invokes PdfSharp 1.32.3057.0 to create a PDF from a given query. PdfSharp registers fine on local dev server (Windows 2012 / SQL Server 2014) but not on QA server (...
1
vote
1
answer
450
views
SQL CLR Parallelism
I have a stored procedure that call a CLR function. They are both on the same database. The CLR function calls a web service. The problem here is that the SQL timestamp is 40s earlier than the ...
2
votes
2
answers
205
views
Is this a valid use case for SqlCLR? Adapting stored procedure results
I have already implemented the CLR stored procedure that I describe below and it works well enough. But I'm not sure if I really need CLR to accomplish this, or if a middle tier solution would have ...
2
votes
1
answer
1k
views
WinSCP Session.PutFiles with Remove=true gets "Error deleting file System Error. Code: 5" when called from SQLCLR but works in SSIS script task
I am creating an assembly file so that get files and put files can be called as a Stored Procedure from SQL Server. Below is the method for put files. When I pass SqlBoolean DeleteLocalFolder=true, ...
2
votes
1
answer
114
views
SecurityException error when calling CLR function "Revisited"
I am running SQL Server locally only.
I am building a project with VS 2017 community.
I created a CLR procedure, and uploaded it as an assembly successfully.
The class and the method are public.
I ...
0
votes
2
answers
229
views
MSSQL CLR function webreqest 401 unauthorized
I have a CLR function getting data from cookie authorized website. The first request gets a login cookies and the second request gets xml data I need. The problem is in that I am always getting 401 ...
0
votes
2
answers
713
views
Recursive hierarchy grouping by string delimiting in SSRS 2016?
I have a SQL Server database as my data source for which my rows contain a path delimited by \
For example:
"\Foo\Bar"
is a folder containing
"\Foo\Bar\Baz".
My database contains a column ...
1
vote
1
answer
2k
views
SQLCLR stored procedure gets "SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission" error
I have created .NET SQLCLR stored procedure, and built and published it on my local SQL Server.
In the .NET code I am using this connection string:
OleDbConnection connection = new OleDbConnection(
...
1
vote
1
answer
486
views
DateTime.TryParse uses wrong format for MSA
A c# sqlclr function containing DateTime.TryParse isn't returning the correct date on a new windows server. The date and regional settings were in US format on this server instead of GB and the sql ...
4
votes
3
answers
11k
views
What is the purpose and risks of enabling SQL CLR?
We are looking to implement unit tests using the tSQLt test framework. It has got a pre-requisite that the SQL CLR must be enabled using this command:
EXEC sp_configure 'clr enabled', 1; RECONFIGURE;
...
0
votes
1
answer
2k
views
"Error converting data type nvarchar to int" when executing Stored Procedure and reading return value
I have a clr stored procedure which has an output value I am calling the sp from a vb.net app with the code below. I am getting an error that says 'Error converting data type nvarchar to int.
1125092|...
0
votes
2
answers
153
views
SQLCLR stored procedure fails to install
I have created a stored procedure in Visual Studio (VS). When I attempt to install the procedure after successfully creating the assembly I get the error:
CREATE PROCEDURE for sp_GetDistanceAndTime ...
2
votes
2
answers
379
views
SQL Assembly WebResponse and String Parsing VERY slow
So I am quickly learning the ways of C# (complete noob that inherited this problem); I have written up the following code which calls a web service that returns JSON that is not always well-formed. ...
7
votes
1
answer
2k
views
CLR function will not return more than 4000 chars
first time posting, please be kind! :-)
New to VB/C#, Trying to fix up a CLR function that calls a web service. I've cobbled together the following:
using System;
using System.Data;
using System.Data....
0
votes
0
answers
38
views
Detect if the SqlContext is read-only (e.g., SqlFunction)
In SQLCLR, I can detect if I'm inside an SqlContext, and if so, perform additional functions like writing to the pipe.
However, how do I detect if I'm inside a read-only SQL context, such as method ...
0
votes
2
answers
85
views
SQLCLR project has build error about 'System.Xml.IXmlLineInfo' not being defined in assembly
I have a SQLCLR project in VS2015, it is set for .NET 4.5.1 and SQL Server 2016. It uses System.Xml.Linq.
When I build the project I get errors saying:
The type 'System.Xml.IXmlLineInfo' is defined ...
4
votes
2
answers
2k
views
SQLCLR - How can I register referenced assemblies of my CLR assembly without setting TRUSTWORTHY ON?
I'm having issue registering referenced assemblies that I used in my SQL CLR assembly. For example I have SQL CLR assembly named Something.dll. This Something.dll references Newtonsoft.dll.
I sign ...
2
votes
1
answer
1k
views
How to verify code signed assembly in SQL
I've read plenty about asymmetric keys and certificates in SQL Server (2012) but those seem to be specifically for signing data. What I have is a SQL CLR assembly that I have signed with a digital ...
2
votes
1
answer
3k
views
Alternative to Linked server, with same speed
I have a framework build with stored procedures that moves data 1 to 1 fra an OLTP to a BI staging area. It is generic, just tell it which table in the OLTP, and it builds the sql to move it.
Problem ...
-1
votes
1
answer
55
views
How should I use SQL Server CLR to employ UDT compiled by C++/C
I got a question on how should I C++/C to deploy SQL Server User Defined Type to hold complex data structure.
I am using VS2017 and SQL Server 2012.
I'm kind of knowing how to do it using C#, while ...
4
votes
1
answer
1k
views
SQL Server CLR project version number increment
Hope some one can help me figure this out.
Problem: I have a sql CLR project in visual studio 2013. Every thing seems to work as I can install the project on SQLServer and call its stored procedures ...
1
vote
1
answer
547
views
Use Entity Framework in CLR Stored procedure
I found a post from seven or so years ago that the Entity Framework could not be used in a CLR stored procedure. Has this been rectified in the past seven or so years? Is an update available that will ...
1
vote
3
answers
7k
views
Using SQL CLR to Call a Web Service
I followed this guys walk-through, which I've seen posted in other Stack Overflow posts: https://code.msdn.microsoft.com/Calling-WCF-Service-from-a-8071ceaa
And I get an error when running my stored ...
1
vote
0
answers
541
views
CLR Assembly in SQL Server Error "Timeout Exceeded" when executed in stored procedure, runs fine in new query window
I have this stored procedure, we'll call "wrapper", that calls another procedure to build an XML message then executes a CLR Assembly to send that XML message to a web service. The web service should ...