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

Passing huge amounts of data as an hexadecimal (0x123AB...) parameter of a clr stored procedure in sql server

I post this question has followup of This question, since the thread is not recieving more answers. I'm trying to understand if it is possible to pass as a parameter of a CLR stored procedure a large amount of data as "0x5352532F...". This is to…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
0
votes
0 answers

SQL Server 2012 - Make image smaller

I have an Image column in a table. The column contains a big image, about 300KB in size. I'm trying to find a way in a SQL command to make a small copy of this image. I would like to make a 15KB copy of it into field2. I looked all over, and the…
Itay.B
  • 3,991
  • 14
  • 61
  • 96
0
votes
0 answers

"For Each" loop to call web service

So I have two systems (ARCHIBUS and MAXIMO) that I need to synchronize some data between. System#1 (ARCHIBUS) has a "transfer table" that data is being dumped into from triggers on other tables. Every night, I need to take the rows in System#1's…
D.R.
  • 1,199
  • 5
  • 19
  • 42
0
votes
1 answer

Is it possible to determine by way of T-SQL Query whether a sproc is CLR-based or regular T-SQL-based?

Hey all. I'm integrating a CLR/Assembly-based sproc replacement for an existing sproc that lives within our production database, and I want to write an update script that only drops the old T-SQL-based script and doesn't drop the new one if its…
bitcycle
  • 7,632
  • 16
  • 70
  • 121
0
votes
1 answer

SQL Server 2012 SqlCLR reads configurations from machine.config instead of sqlservr.exe.config

I have a SQLCLR project deployed to SQL Server 2012, the project reads some app settings from the configuration file, the configuration file for sql must be inside the \Binn folder of the sql root folder, but it fails to read the settings from there…
0
votes
1 answer

Add Entity Framework CLR DLL to SQL Server Database

I have a program that is intensive in CRUD operations on a SQL Server Express 2012 database. I was hoping to create a CLR assembly that contained most of the code and then attach it to the database so that it would stay on the server. I was hoping…
Milliron X
  • 1,174
  • 14
  • 26
0
votes
1 answer

Sql Clr User Defined Type parsing a float and losing precision

I've got a Clr user defined type that takes a string of values sepertated by a comma. I'm losing a little bit of precision when converting to this type, I've narrowed it down to this line of code: cast(cast(nlinkjt as nvarchar(100)) + ','…
Hath
  • 12,606
  • 7
  • 36
  • 38
0
votes
1 answer

Is there any database technology comparable to the SQL CLR?

Is there any database technology comparable to the SQL CLR? Specifically, one that allows me to code high-performance routines in a common programming language like C# with shared memory (e.g. static variables) that can be called directly from…
Triynko
  • 18,766
  • 21
  • 107
  • 173
0
votes
1 answer

SQLCLR running too slow

I have 1.6 million rows in a table. there are 100,000 rows which has some information missing. To locate that information without duplicate references. I have written a SQL CLR procedure. It is executing at very slower speed. Only 5000 Rows are…
Amritpal Singh
  • 1,765
  • 1
  • 13
  • 20
0
votes
1 answer

Replacing characters with CLR C# library connected to SQL Server

Just wrote simple library that replace polish diacritic signs with normal ones in given string, for example ą->a, ć->c etc. The problem is - when I call function from sql like this: select MyReplace('ąśćźń') it gives me correct string -…
Patryk Lipski
  • 163
  • 10
0
votes
1 answer

CLR Assembily creation error

I was created one CLR assembly in SQL server 2012. It shows the below error.. Please advise on the below error Assembly 'ElasticSearchCLR' references assembly 'system.data.linq, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.',…
Kirupananthan.G.S
  • 265
  • 1
  • 3
  • 9
0
votes
0 answers

SQL CLR executes with multiples sql statements

I need a SQL CLR that executes with multiple sql statements, i.e., with update queries, select queries and stored procedures to create a stored procedure in the database [Microsoft.SqlServer.Server.SqlProcedure] public static void…
beto13
  • 49
  • 6
0
votes
1 answer

'The default schema does not exist' on deploy of SQL CLR assembly onto SQL Server 2008

I'm deploying an example SQL CLR stored procedure which has a SQL CLR type as parameter using Visual Studio 2008 and menu Project -> Deploy. public partial class StoredProcedures { [Microsoft.SqlServer.Server.SqlProcedure] public static void…
abatishchev
  • 98,240
  • 88
  • 296
  • 433
0
votes
1 answer

Not able to find the "SQL Server Project" template in Visual Studio 2010 Professional to work with CLR SQL Server Trigger

I am newbie in working with CLR SQL Server Trigger. I am following MSDN How to Create a SQL Server Project link. Point 4 on this page says that I have to select SQL Server Project template as my new project. But in my Visual Studio 2010 Professional…
Jitender Kumar
  • 2,439
  • 4
  • 29
  • 43
0
votes
1 answer

Error on dt.AsEnumerable() - 'System.Data.DataTable' does not contain a definition for 'AsEnumerable'

This is my clr code in which I am getting the above error. I tried adding reference System.Data.Entity but the problem still remains. using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using…
user1254053
  • 755
  • 3
  • 19
  • 55