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

Convert SQL CLR Project from VS 2010 to VS 2012

I have a SQL CLR project that was created in Visual Studio 2010 that I am trying to open in Visual Studio 2012. The UpgradeLog.htm file shows a successful migration but when I try to reload the project I get these errors in the Visual Studio output…
Rick S
  • 6,476
  • 5
  • 29
  • 43
0
votes
1 answer

CLR function Unsupported type

The building of the following CLR function will get the following error /* Error: Unsupported type. */ in the automatically generated SQL. Which type caused the problem? The MSDN document https://msdn.microsoft.com/en-us/library/ms131103.aspx was…
ca9163d9
  • 27,283
  • 64
  • 210
  • 413
0
votes
1 answer

Does a CLR stored procedure for SQL Server need to access the database?

Currently I'm in a bit of a sticky situation where we can't get access to an external database and instead are pulling the data via their REST API. This data needs to be pulled prior to the execution of a stored procedure that performs analysis on…
mcnnowak
  • 265
  • 3
  • 17
0
votes
2 answers

How to check for nested square brackets?

I have the input string below: [text1][text2][text3]...[textN] and I want to apply the following validation rule using regular expression: The ] and [ cannot be included in other []. For example, the next input strings are not…
gotqn
  • 42,737
  • 46
  • 157
  • 243
0
votes
1 answer

CLR Integration function that will take an Image/Varbinary value as input

I am trying to create a CLR integration function in SQL Server 2008 R2 which will read a Image/Varbinary value and return a NVARCHAR(MAX). [Microsoft.SqlServer.Server.SqlFunction] public static SqlString ConvertByteArrToString(SqlBinary…
0
votes
2 answers

What's the most efficient way to parse these 500k rows?

I currently have a database full of ACL entries which looks like so: I need to go through and parse out the difference between a root node (like \\chrlcltsvr02\AYY_LMO\ClientServices) and it's child nodes (ex.…
cjones26
  • 3,459
  • 1
  • 34
  • 51
0
votes
1 answer

Can't change the Target Framework

I have a project written in visual studio 2008. I want to upgrade to a newer .NET framework. But everytime I open the project and try to change the target Framework it changes back to .NET 2.0. Let me know if you need more info. I open the…
user3514987
  • 210
  • 3
  • 9
0
votes
3 answers

Best solution to import records from MySQL database to MS SQL (Hourly)

I need to import records stored in a MySQL Database that I do not maintain into my Sql Server 2005 database (x64) We should import the records at an interval basis (probably 1 hour). What would be the best solution to perform the regular…
xkingpin
  • 631
  • 8
  • 16
0
votes
1 answer

Unable to execute stored procedure created in SQLCLR

I have create a stored procedure in SQLCLR (SQL Server Database Project, VS2012). I publish the stored procedure successfully to the database. But when I run the stored procedure in the database, I get an error. Cannot load dynamically generated…
0
votes
0 answers

Cannot Debug CLR User Defined Type

I'm trying to debug a CLR User Defined Type in SQL Server 2014 / Visual Studio 2013. I can deploy my UDT to the database and execute the script that calls that UDT in the debugger from within visual studio but it throws an error and doesn't hit my…
JasonLind
  • 370
  • 2
  • 13
0
votes
1 answer

msbuild error building sql clr dll in TFS

We have SQL CLR dll that we developed quite a long time ago that we have been using. Unfortunately it wasn't ever in our normal daily builds.We are going to be upgrade our sql server from 2008 R2 to 2014. So i opened the project and upgrade it to a…
coding4fun
  • 8,038
  • 13
  • 58
  • 85
0
votes
1 answer

Can I use SQLCLR stored procedure to update a column of a database table

I wanted to update the values of a few columns of a database table, using queries or stored procedure, but wanted to use my C# library to alter the value. For ex, I want the columns A,B,C of table T to be replaced with Encrypt(A), Encrypt(B) and…
Shweta Saxena
  • 327
  • 1
  • 2
  • 15
0
votes
1 answer

Can I use SQLCLR stored procedure to update a column of a database table ( using some compiled dll)

I wanted to update the values of a few columns of a database table, using queries or stored procedure, but wanted to use my C# library to alter the value. For eg, I want the columns A,B,C of table T to be replaced with Encrypt(A), Encrypt(B) and…
Shweta Saxena
  • 327
  • 1
  • 2
  • 15
0
votes
2 answers

How to configure outgoing connections from an SQL stored procedure?

I am working on a .NET project which uses Microsoft SQL server. In this project, I need a CLR stored procedure (written in C#) that uses a remote web service. So, when the stored procedure is executed on the SQL server, it makes web service calls…
0
votes
1 answer

Receiving SQL Server events from a CLR function

I wrote a CLR class with several methods, which are linked as functions in a SQL Server 2005 database. When several of these functions are used in scope of one transaction or connection, I need another one to be automatically executed to clean up…