Questions tagged [sqlclr]

SQLCLR (SQL Common Language Runtime) is technology for hosting of the Microsoft .NET common language runtime engine within SQL Server. The SQLCLR allows managed code to be hosted by, and run in, the Microsoft SQL Server environment.

SQL CLR or SQLCLR (SQL Common Language Runtime) is technology for hosting of the Microsoft .NET common language runtime engine within SQL Server. The SQLCLR allows managed code to be hosted by, and run in, the Microsoft SQL Server environment. This technology, introduced in Microsoft SQL Server 2005, allow users for example to create the following types of managed code objects in SQL Server in .NET languages such as C# or VB.NET.

  • Stored procedures (SPs) which are analogous to procedures or void functions in procedural languages like VB or C,
  • triggers which are stored procedures that fire in response to Data Manipulation Language (DML) or Data Definition Language (DDL) events,
  • User-defined functions (UDFs) which are analogous to functions in procedural languages,
  • User-defined aggregates (UDAs) which allow developers to create custom aggregates that act on sets of data instead of one row at a time,
  • User-defined types (UDTs) that allow users to create simple or complex data types which can be serialized and deserialized within the database.

The SQL CLR relies on the creation, deployment, and registration of .NET assemblies, which are physically stored in managed code dynamic load libraries (DLLs). These assemblies may contain .NET namespaces, classes, functions and properties.

Source: http://en.wikipedia.org/wiki/SQL_CLR

969 questions
0
votes
1 answer

SQL CLR return two new columns

I have a SQL CLR function which at the moment returns a string seperated by a comma. How would I code the statement to return two new columns into my resultset. For example Select A, B, MyCLRFunction(X,Y) C From MyTable Returns:- One Two …
general exception
  • 3,752
  • 6
  • 46
  • 78
0
votes
1 answer

CLR SP with unmanaged code

i have some code in C++ (www.NR.com functions), which i would like to use in SQL Server 2008R2 CLR SP. Tried to make a wrapper in C#, but no luck. Perhaps somebody has a working sample or manual how to make such wrapper and set all required…
Alex Dybenko
  • 490
  • 1
  • 4
  • 11
0
votes
1 answer

SQL CLR in which scenario will give better better performance?? we observed for string and mathematical operation.

We recently had a need to validate lot of address (strings) in SQL Server, t-sql code was showing latency we tried SQL CLR and wow! 700% performance improvement. We are looking at what other places we can use it??? I guess not all logic should be…
Pritesh
  • 1,810
  • 7
  • 29
  • 43
0
votes
1 answer

SQL-CLR stored procedure doesn't return value

I looked through Stackoverflow and found almost identical question here. It was asked a year ago and nobody answered it yet. Maybe I'll be more lucky than user1038334 and somebody will help me. I have a SQL CLR stored procedure which works fine for…
davidoff
  • 1,987
  • 3
  • 15
  • 21
0
votes
1 answer

Validation Functionality within SQLCLR and its Performance

I have to validate all Data rows within the Table as soon as new row is inserted. DETAILS: Each and every row inserted into the table should pass through set of validation rules, and these rules may vary based on data within the row. When written in…
sandeep
  • 2,704
  • 9
  • 40
  • 52
-1
votes
1 answer

Webservice call failing inside SQL Clr code due to SSL

I am invoking a web Service call inside SQL Clr table valued function (C#). When the sql function is invoked following error is received "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure…
paranjai
  • 521
  • 2
  • 5
  • 25
-1
votes
1 answer

Use Cryptography.RSACryptoServiceProvider assembly in SQL Server 2017 for decryption

In my asp.net MVC project, i created functions to encrypt/decryt via RSA which works fine as expected. I stored public/private keys on azure vault and accessing on runtime which is also fine. I am using those functions to encrypt the data at…
Jitendra Pancholi
  • 6,617
  • 8
  • 39
  • 72
-1
votes
1 answer

How do I add parameters to my queries when using clr/c++ for multiple variables

I want to be able to add parameters to my queries to make my statements less vunerable to sql injections My code (Key parts are surrounded by ** as I cannot make code bold) OleDbConnection^ existingSqlConnection = nullptr; …
L.A
  • 21
  • 8
-1
votes
2 answers

SQL Server 2017 Management Studio: CREATE ASSEMBLY error

I created user defined type in C#. When I run this: EXEC sp_configure 'clr enabled', 1; RECONFIGURE; GO EXEC sp_configure 'show advanced option', '1'; RECONFIGURE; GO USE NameOfDatabase CREATE ASSEMBLY Database1 FROM…
Lazar
  • 37
  • 7
-1
votes
1 answer

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 I prefer C++/C much more and it provide me faster…
Shore
  • 559
  • 2
  • 12
-1
votes
1 answer

Group concat with history in SQL Server

This post is not intended to start a discussion about the best method of group concatenation of strings in SQL Server because many articles have already done that. I'd like to use a method like this for the group concatenation piece itself:…
devinbost
  • 3,527
  • 2
  • 32
  • 41
-1
votes
1 answer

PHP using SQL Server CLR Stored Procedure how to consume return value

I have stored procedures written in CLR (C#) that are sitting in SQL Server DB. When I run those procedures I get return value as well as output. Procedure code is: using(SqlConnection conn = new SqlConnection("context connection=true")) { …
-1
votes
1 answer

Return Table Stored Procedure

Currently work with multiple servers and need to return the results in a table, how can I do? I intend to get data from each bank and return all through a single procedure. Example, caught available space of the server and return in table…
Fabiano Carvalho
  • 461
  • 1
  • 4
  • 16
-1
votes
1 answer

Cannot Update a table with TVF results

I have a complex CLR function which returns a single row. I can use Cross Apply to select results which works fine but an Update or Insert fails. The select always works however insert,select into and update fails with below error, this error doesnt…
Anand Verma
  • 263
  • 4
  • 10
-1
votes
1 answer

Use MSSQL CLR to retrieve data as json

this is my Problem, i have a table with more than 1 million records and im using these record to generate some reports using crystal reports, but when selecting large number of records some time occur timeout erorros or sometime computer getting…
1 2 3
64
65