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
-1
votes
1 answer

Getting string value from SQL function inside a CLR

Attempted (non-working) solution included below. I have an sql function called get_parameter which looks in a table for a given string and returns the associated string: declare @str varchar(20); set @str = dbo.get_parameter('filecount') print…
elbillaf
  • 1,774
  • 10
  • 35
  • 61
-1
votes
2 answers

SQLServer CLR with parameters

I try to make a CLR in C# to use in SQLServer Management Studio 2014. Everything's working fine right now, unless I start to insert parameters. How do you insert a parameter in the CLR and use it in a PROC? I tried to put the parameters in the…
user3208216
  • 84
  • 1
  • 8
-1
votes
1 answer

Is it good to use Threads in CLR SQL?

There are 1,00,000 Update Statement available in a SQL table EexecuteQueue Below is the Step I am planning to do. Identify the Logical Processor of the Database server. The queries available in the EexecuteQueue table will be split in to number of…
-1
votes
1 answer

Unable to read text file used in CLR function when deployed to SQL Server 2008

I created a CLR user-defined function in C# for DID you mean implementation on my website and deployed the DLL in SQL Server 2008. But the dictionary after reading the text file is returned blank. Below is some part of the code but the problem is in…
-2
votes
1 answer

How can we call SSL Web Service from SQL Server CLR?

I have a web service and I want to call it from https. What is the solution? This work for http.
masoud ramezani
  • 20,058
  • 28
  • 92
  • 149
-3
votes
3 answers

Convert VB CLR function to C#

How can I convert below VB.net SQL CLR function to C# CLR Function for a VS SSDT SQL Project? I need to convert it to C# as it seems that built-in SSDT Project support for CLR functions is C# only? If I could find a way to use the original VB in a…
Adam
  • 1,715
  • 1
  • 26
  • 51
-3
votes
1 answer

NullReferenceException during compilation of a SQLCLR function

I am running a sql server function below on 5 different databases on sql 2016 instance: select * FROM fn_myfunction('', 0, 0,'30 Apr 2015','1', 0) And am getting this error message: Msg 10313, Level 16, State 51, Line 1 An error occurred while…
Immortal
  • 893
  • 1
  • 11
  • 30
-3
votes
1 answer

Calling CLR Stored Procedure out of Context

This is my external procedure: using (SqlConnection con = new SqlConnection("context conection=true")) { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; if (con.State == ConnectionState.Closed) { con.Open(); } …
Shahid Iqbal
  • 1,883
  • 8
  • 26
  • 50
-5
votes
2 answers

Type 'StoredProcedures' already defines a member called 'AddNumber' with the same parameter types

I have created a Visual C# SQL CLR database project. I added two stored procedure: test1.cs and test2.cs. I have a function in test1.cs as AddNumber. In test2.cs, I want to have a function with the same name which will do something else, but this is…
user1254053
  • 705
  • 2
  • 17
  • 48
1 2 3
64
65