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

Calling CLR stored procedure

Possible Duplicate: Invoking CLR stored procedures Does anybody know how to call a CLR stored procedure using select statement?
Shami C
  • 87
  • 1
  • 7
0
votes
1 answer

Consuming web-service using SQL CLR stored procedure not find default endpoint while debugging with VS2010

We develop SQL CLR stored procedure which calls methods of a web-service. We use VS2010 to develop and debug this project. The problem is the following exception when we try to start test script which calls our stored procedure: A .NET Framework…
Serg
  • 2,346
  • 3
  • 29
  • 38
0
votes
1 answer

How do you check the version number of a sql server clr?

What is the best way to check / version a sql server clr? I am currently creating a SqlFunction that returns a version number (which I set before release). This allows me to query the version e.g. select mySchema.GetClrAppVersion Any thoughts or…
Andrew
  • 5,215
  • 1
  • 23
  • 42
0
votes
2 answers

SQL Server: stored procedure and CLR Proc return data differently

I'm using Delphi XE2 to call a stored procedure that returns data. The stored procedure is basically: set nocount on -- ensures that Delphi will see that dataset ... exec StoredProcThatReturnsData ... update [table] update [another table] When the…
James L.
  • 9,384
  • 5
  • 38
  • 77
0
votes
1 answer

CLR-based UDT and string property in SQL Server 2008R2

Is there absolutely no way to have a property of a string type as part of CLR-based UDT? I know strings are non-blittable, but I really need one are there any tricks allowing to squeeze through that limitation?
user1514042
  • 1,899
  • 7
  • 31
  • 57
0
votes
1 answer

Can I develop an SQL/CLR function that can accept arguments of any type like MAX()?

For example, can I develop MAX() function using C# by myself? Thanks!
xiagao1982
  • 1,077
  • 1
  • 13
  • 25
0
votes
1 answer

Problems with VS2012 SQL CLR and LINQ

We are beginning to use VS2012 for our solution. One of the projects is SQL CLR. When I try to compile it, I get the following error: CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly…
laconicdev
  • 6,360
  • 11
  • 63
  • 89
0
votes
1 answer

SQL CLR - dll download and registration

I am working with SQL CLR.I do not have Visual Studio. I have SQL server installed, so I do have the .NET environment. I have been trying to work with a piece of code but I kept getting an error on this line: Import…
0
votes
2 answers

DateTime2 as input parameter datatype in Table-Valued Function

I have the following table-valued function: [Microsoft.SqlServer.Server.SqlFunction(SystemDataAccess = SystemDataAccessKind.Read, FillRowMethodName ="XXX", TableDefinition = "time DateTime2"] public static IEnumerable…
Pacman
  • 2,183
  • 6
  • 39
  • 70
0
votes
2 answers

SQl server TVF CLR function returns row index?

I have this simple C# code which is used by Sql Server to return TVF: [SqlFunction(FillRowMethodName = "FillRow3")] public static IEnumerable GetCsv(string csv) { string[] arr = csv.Split(','); return arr; } public static void…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
0
votes
1 answer

Is there anyway to be able to reference xml/text columns in the "inserted" and "deleted" tables in a SQL Server 2008 (CLR) trigger?

I get an exception when I "Select * from deleted" in a clr trigger in SQL Server 2008. Is there anyway to be able to access xml/text columns from the deleted and inserted tables in a trigger?
Saturn K
  • 2,705
  • 4
  • 26
  • 38
0
votes
8 answers

sql join problem with negatives

I need to select data from two table using a join. This is fairly simple and have no problems here. The problem occurs when the field I am joining is used as two separate foreign keys (I didn't design this). So the ID field that I join on is either…
Tikeb
  • 978
  • 3
  • 9
  • 25
0
votes
3 answers

How can I automatically restart a stopped stored procedure in SQL Server 2008?

I have a stored procedure which must be constantly running. Occasionally, for a currently unknown reason, it stops. How can I make it automatically restart the SP if this happens? Google searches aren't helping much, as all the results are about…
0
votes
1 answer

How to improve the Replace function in CLR function?

I have a CLR function to replace string values. but it runs a long time. How can I improve this function and make it runs faster? public static SqlString ReplaceValues(String Value) { // Put your code here char[] c = new char[] { '.'…
st mnmn
  • 3,555
  • 3
  • 25
  • 32
0
votes
5 answers

Difference using localhost, 127.0.0.1, computer name and static ip

I want to consume a web service that is running on the local machine (don't ask me why, I didn't make the web service, just need to use it), and I want to know if there is any difference (technical and maybe performance) by referencing it via…
Guillermo Gutiérrez
  • 17,273
  • 17
  • 89
  • 116