The tag has no wiki summary.

learn more… | top users | synonyms (1)

9
votes
3answers
282 views

Retrieving n rows per group

I often need to select a number of rows from each group in a result set. For example, I might want to list the 'n' highest or lowest recent order values per customer. In more complex cases, the ...
1
vote
2answers
65 views

Security or performance risks using SQL CLR [closed]

Are there any particular security or performance risks in using the CLR in SQL Server ?
3
votes
1answer
159 views

resource wait SQLCLR - wait_type CLR_SEMAPHORE by SPID 0

UPDATE In the comments under Aaron's post is an extensive explanation why I want to find this out, please read it if you want to know. The system is running some ETL, reporting services and a ...
1
vote
1answer
60 views

In a SSDT project how to avoid redeploying the assembly?

I have a SSDT project that has a few sql clr elements. They rarely get altered but every time I redeploy my db project it decides it must drop the assembly and recreate it. I think its somewhat ...
0
votes
1answer
35 views

xp_logevent Invalid Parameter Type

I'm working with SQL Server 2012 Enterprise Edition SP2 on a Windows 7 32bits. I have this code inside a stored procedure. Begin try -- EXEC CLR Stored Procedure exec ...
2
votes
2answers
392 views

Assembly 'system.web, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.' was not found in the SQL catalog

I am trying to deploy a SQL CLR function using the HTTPUtility.UrlDecode method of System.Web but I can't get it to deploy. Error received: .Net SqlClient Data Provider: Msg 6503, Level 16, State ...
4
votes
1answer
111 views

How can “HierarchyID” type work when “CLR” is disabled?

The following statement sp_configure 'clr enabled' returns: name minimum maximum config_value run_value clr enabled 0 1 0 0 I assume this means there are no CLR ...
1
vote
0answers
112 views

“Failure occured while attempting to connect to the Principle server” from CLR procedure

I have a Windows Service running under a domain account which calls a stored procedure which then calls a CLR stored procedure. Initially I had a problem where database ownership chaining wasn't ...
1
vote
2answers
167 views

Migrating CLR Assemblies

I am migrating a SQL Server 2008R2 database to a new server. (also 2008R2) There are a number of CLR assemblies on the server. Will these automatically migrate with the database or will I have to ...
0
votes
0answers
42 views

I am trying to implement Scott Chamberlain's code in SQL Server 2008 R2 . Getting Assembly not present errors

I am trying to use Scott Chamberlain's code, here: http://dba.stackexchange.com/a/17466/45380 I was able to compile it and create the DLL, but now when I try to run SQL CREATE ASSEMBLY I get: Msg ...
3
votes
1answer
1k views

App domain is marked for unload due to memory pressure

In my sql server log (2005 SP4) I have this message every couple of seconds : "AppDomain XXX [DataBase.dbo[runtime], YYY] is marked for unload due to memory pressure" Our server : Windows Server ...
1
vote
1answer
194 views

Variable numbers of parameters in a SqlClr UDF or Stored Proc

Lets say I have the following signature for a CLR Stored Proc or UDF: [Public] public static void RaisError( string message, short severity, short state, params object[] args) ...
4
votes
1answer
710 views

Reference assembly in sqlproj not being deployed to server

I have a Visual Studio 2013 Database Project which takes a modified version of fastJSON as a reference. I selected Generate DDL in the reference properties as shown in this screenshot: And in the ...
2
votes
1answer
209 views

Getting Visual Studio to deploy a UDF to Return NVARCHAR(MAX)

I have a SQLCLR stored procedure with the following signature in Visual Studio 2013: [SqlFunction(DataAccess = DataAccessKind.Read, SystemDataAccess = SystemDataAccessKind.Read)] public static ...
0
votes
0answers
124 views

Comparing CLR Functions in Visual Studio SSDT

I'm comparing the CLR functions from a pair of SSDT projects to a database. The only difference shown in the comparison is on two properties: IsDeterministic and DataAccess The compare shows that the ...
2
votes
1answer
138 views

How to access external DLL's static methods that incorporate output parameters in SQL Server

I know how to load a CLR DLL in SQL Server and access to its static methods which does not incorporate output parameters in their method signatures but what I cannot realize is how I can use methods ...
6
votes
1answer
296 views

SQL Server: How to get the responsiveness of a trigger, without blocking the transaction that fires the trigger?

On a thread today I posed a desire to get code to execute immediately when a record is inserted rather than resorting to polling. Triggers are powerful tools, yet dangerous places to put real code, ...
0
votes
0answers
146 views

XML Serialization in SQL Server 2005 CLR

I know this question has been asked before, but none of the answers I've tried seem to work for me. I'm trying to execute a CLR Stored Procedure in Sql Server 2005. The CLR generates a file, sends it ...
4
votes
1answer
286 views

Suggest better design pattern for reverse DNS lookups

I'm working on a project where I need to look up the hostnames associated with IP addresses who were logged making HTTP requests. The lookups currently happen as part of a daily ETL job. The current ...
1
vote
1answer
350 views

Counting the number of calls of a stored procedure

I have a CLR sp in SQL Server 2008 R2, and I want to count how often it is called, in order to create a statistic on data quality. (The sp allows manual correction of data). How can I let a counter ...
3
votes
0answers
210 views

Mathematical method for spotting irregularity in numbers flow

I am trying to build an engine which is going to predict orders for items inside shop. Three main variables are: Time-dates (x-axe etc 1.1.2013,1.2.2013 etc I do calculation one per day) Available ...
4
votes
1answer
374 views

Understanding MS SQL Server Date Types

Consider the following: declare @dt datetime, @dt2 datetime2, @d date set @dt = '2013-01-01' set @dt2 = '2013-01-01' set @d = '2013-01-01' select convert(varbinary, @dt) as dt, ...
2
votes
0answers
503 views

Passing NULL xml value to a certain CLR stored function crashes it when called in a certain way

Consider a CLR stored procedure that accepts an XML parameter and calls another stored procedure in the same schema: [SqlFunction(DataAccess = DataAccessKind.Read, IsDeterministic = false, ...
2
votes
0answers
253 views

Multithreading caching in SQL CLR

Is there any mechanism available to a SQLCLR assembly for caching that will still work when the assembly is registered as "safe"? The cache needs to be thread-safe, so it can be shared by multiple ...
1
vote
0answers
507 views

Asynchronous processing of SQL CLR results that can dynamically add more work [closed]

I have an application that consists of Web-services that make calls to a sharded SQL Server database. Each database node has a SQL CLR stored procedures, which given some number of records to process, ...
4
votes
1answer
482 views

How do I create a CLR UDF with external name specifying namespace, class, and subclass?

I am creating a CLR UDF using external name and second level nested class names seem not to be permitted. Is this the case? When using the following syntax and including a first level class name and ...
2
votes
2answers
295 views

Is there a SQL Server 2008 R2 specific target for SSDT projects?

I am making a SQLCLR stored procedure in Visual Studio 2012. I have these options for target platform: Is there not a SQL Server 2008 R2 specific option? Is this because SQL 2008 R2 shares the same ...
4
votes
1answer
5k views

How to grant a user UNSAFE ASSEMBLY permission

How can we assign a user , e.g.: the database owner (DBO) the UNSAFE ASSEMBLY permission? I'm asking it to enable a user to create an assembly and don't know the SA password, so EXEC sp_changedbowner ...
5
votes
1answer
647 views

Calling a .NET method in a SQL Server script

In the data migration process, I need to convert some columns values form the source system before writing to the target table. I've been provided with a Csharp code which reads a string and do the ...
5
votes
1answer
349 views

Is there anyway to make sql server search the master database for SQLCLR stored procedures before the current one?

For T-SQL stored procedures with the prefix sp_, SQL Server will search for and user a procedure in the master database before the current one. This does not appear to be the case with a SQLCLR stored ...
2
votes
2answers
157 views

Visual Studio DAC with Schemabound View containing hierarchyid::GetRoot() - Two part name needed?

In Visual Studio, when trying to create a DAC which has a schemabound view which contains hierarchyid::GetRoot() this error is generated and the project does not build. However, the t-sql is ok as if ...
7
votes
2answers
520 views

Other then restarting SQL Server, is there any way to force the SQLCLR AppDomain to be reset?

I want to force the AppDomain being used by SQLCLR to be reset. How can I do that besides restarting the SQL Server instance?
10
votes
2answers
2k views

Do SQL Server Express Editions support CLR procedures?

Do SQL Server Express Editions (2005, and 2008) have support for installing, enabling and running CLR Stored procedures and functions.