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

1004 questions
-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
  • 504
  • 1
  • 6
  • 17
-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
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,952
  • 10
  • 37
  • 73
-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…
-1
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,862
  • 9
  • 44
  • 54
-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
  • 22,228
  • 29
  • 98
  • 151
-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,932
  • 2
  • 32
  • 57
-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
  • 1,133
  • 1
  • 15
  • 35
-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
  • 2,095
  • 8
  • 31
  • 51
-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
  • 755
  • 3
  • 19
  • 55
1 2 3
66
67