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
0 answers

Asynchronous T-SQL triggers

Suppose you have the the following scenario: CREATE TABLE dbo.testwait1 (id INT) GO CREATE TABLE dbo.testwait2 (id INT) GO CREATE TRIGGER testwait1t ON dbo.testwait1 FOR INSERT AS BEGIN INSERT INTO testwait2 (id) END GO CREATE TRIGGER…
Rawle
  • 199
  • 12
0
votes
0 answers

Assembly 'amqmdnet' could not be installed because existing policy would keep it from being used

Hi, I try to register amqmdnet.dll (a part of IBM WebSphere MQ for Windows) in SQL server in order to deploy SQL SQL CLR stored procedure to use it for MQ mesaging. The code is: …
Boogier
  • 609
  • 6
  • 24
0
votes
1 answer

SQL Server CLR User-Defined Types: how to work via OLEDB?

How to work with SQL Server CLR User-Defined Types in old good C++ unmanaged code via OLEDB? Also, how to work with Large User-Defined Types? What are these types in OLEDB? How to interpret them?
ZedZip
  • 5,794
  • 15
  • 66
  • 119
0
votes
0 answers

How to debug database project?

Ok, I'm using Quartz.NET, I have a table, when the database in that table change (after inserted, updated) I have to download a file from url, then parse that file, and insert data to another table.... I do all of this in SQL CLR Trigger. Because I…
Vu Nguyen
  • 3,605
  • 3
  • 22
  • 34
0
votes
0 answers

CLR sql procedure not visible in Crystal Reports XI

project I am currently working in, has posed a need to implement portion of business logic in CLR stored procedure in Visual Studio 2010. Once I create it, I successfully deploy it to SQL Server, and am able to use it in SQL Server Management…
0
votes
1 answer

Sql Server Local to UTC conversion

I've been wrecking my head with this for the last day or so, and I hope someone here can shed some light. I recently migrated to Amazon RDS SQL Server which is in UTC. However, all my times in the database are in the local time zone (Western…
sTodorov
  • 5,435
  • 5
  • 35
  • 55
0
votes
1 answer

SQL stored procedure to insert data into Mongo DB

At present we got a windows service which runs a stored procedure to transfer data from one table to another. Now we need to change the stored procedure to transfer data from SQL table to Mongo collection. Could some one with Mongodb experience…
0
votes
1 answer

Reference to SQL Database Project (SQLCLR) Throws "type or namespace could not be found" Error

I have spent literally a 1 1/2 days Googling for a solution to this issue to no avail. I am unable to reference a compiled SQLCLR assembly from code, in another project. I can add the reference to the other project, but when I try to add a "using"…
0
votes
0 answers

Trouble with CREATE AGGREGATE

The following is the top of the CLR module: namespace CustomAggregates { [System.Serializable] [Microsoft.SqlServer.Server.SqlUserDefinedAggregate( Microsoft.SqlServer.Server.Format.Native, IsInvariantToDuplicates = false, …
Metaphor
  • 6,157
  • 10
  • 54
  • 77
0
votes
3 answers

Do multiple SQL/CLR calls of the same procedure run at the same time (like threads)?

I have a singleton (because i thought it would be usefull to have these available all the time) to represent some settings, which will clear the old and load the new settings from the database at the beginning of the clr procedure call. But if CLR…
Staeff
  • 4,994
  • 6
  • 34
  • 58
0
votes
1 answer

Find and Read registry key within CLR

I need to check the availability and also read some registry key by CLR(C#), registry keys already written by another application. As a sample: public bool IsKeyAvailable(string KeyID) { string keyToRead = @"Software\myRoot\myApp\" + KeyID; …
0
votes
1 answer

Call WCF Service through SQL CLR

I have followed all the steps in below link. http://support.microsoft.com/kb/913668 - Method 2 But still I'm facing the same error 'Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality…
user2537735
  • 117
  • 1
  • 2
  • 11
0
votes
3 answers

Why is my SQL CLR stored proc call claiming I am not providing a parameter I am?

In a CLR procedure I have the following method: private static void EndOwnershipForTeam(long assetId, int teamId) { const string storedProcedureName = @"up_RemoveAssetOwnershipFromTeam"; using (var connection = new SqlConnection("context…
KallDrexx
  • 27,229
  • 33
  • 143
  • 254
0
votes
1 answer

How do I get SQL Server Management Studio to use .NET 4?

Context: SQL Server 2012 Microsoft SQL Server Management Studio 11.0.3128.0 Microsoft Data Access Components (MDAC) 6.1.7601.17514 Microsoft MSXML 3.0 4.0 5.0 6.0 Microsoft Internet Explorer …
bugmagnet
  • 7,631
  • 8
  • 69
  • 131
0
votes
2 answers

Getting error in CLR execution

I think this may be the same as This Issue I have also referenced it but still not able to get the solution of my problem. This is the first time I am creating any CLR and getting problem. I have delveloped a CLR into C# as:: public partial class…
Rahul
  • 2,309
  • 6
  • 33
  • 60