Questions tagged [clrstoredprocedure]

is stored procedure for Microsoft SQL Server which is built using .NET Framework.

CLR stored procedure is built using Microsoft SQL Server integration with the .NET Framework common language runtime (CLR).

103 questions
93
votes
5 answers

The database owner SID recorded in the master database differs from the database owner SID

When I try to install tSQLt onto an existing database i get the following error: The database owner SID recorded in the master database differs from the database owner SID recorded in database ''. You should correct this situation by resetting…
JDPeckham
  • 2,414
  • 2
  • 23
  • 26
8
votes
2 answers

Global exception handler in CLR Stored Procedure

I use C# and Sql Server 2008 and I have some try/catch blocks in my CLR Stored Procedure and these are caught. These are logged in a file and they return a code error and message using SqlPipe. These work fines. Now I need to do the same when I have…
Dan
  • 625
  • 2
  • 7
  • 23
6
votes
5 answers

How to generate SQL CLR stored procedure installation script w/o Visual Studio

I am working on CLR stored procedure using VS2010. I need to generate standalone deployment script to install this procedure at customer servers. Now I am using Visual Studio which generate such script when I press F5 and try to debug SP on DB…
Victor Haydin
  • 3,518
  • 2
  • 26
  • 41
5
votes
1 answer

Calling unmanaged C/C++ DLL functions from SQL Server 2008

I have a vast library of C/C++ functions, which needs to be called from SQL Server 2008. I have written a C# adapter class which loads these functions from Win32 DLL with DllImport and exposes them to .Net code. This works perfectly fine in most…
Ramzay
  • 181
  • 4
  • 12
5
votes
2 answers

Error doing an MSBuild on a CLR Storedprocedure project on Build Server

When building a CLR Storedprocedure Project using MSBuild on our build server (Team City) we're getting the following error: error MSB4019: The imported project "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\SqlServer.targets" was not found.…
CraftyFella
  • 7,520
  • 7
  • 47
  • 61
4
votes
1 answer

Issues and resolutions while using CLR stored procedures?

We are floating a new scalable and performance-centric ASP.Net application in our organization which is currently in design phase. The managers have decided taking a hybrid approach. They have decided to use CLR stored procedures extensively while…
4
votes
1 answer

Calling T-SQL stored procedure from CLR stored procedure

Very brief background: We are making use of CLR stored procedures to apply access control, using Active Directory, on query results to restrict what the end user can see accordingly. In a nutshell, this is done by removing rows from a datatable…
4
votes
1 answer

How do I deploy a CLR Stored Procedure via the MsBuild command line?

I can deploy a SqlClr project project from Solution Explorer by right clicking it an selecting Deploy. However, I would like a command line version where I can also specify custom ConnectionString.
Tahereh Farrokhi
  • 601
  • 1
  • 6
  • 11
4
votes
1 answer

SQL CLR Stored Procedure and Web Service

I am current working on a task in which I am needing to call a method in a web service from a CLR stored procedure. A bit of background: Basically, I have a task that requires ALOT of crunching. If done strictly in SQL, it takes somewhere around…
Nathan
  • 1,435
  • 5
  • 18
  • 28
4
votes
1 answer

.NET Framework execution was aborted. Another query caused the AppDomain db.dbo[runtime].4 to be unloaded

I have a SQL CLR Function (written in c#.net) that I'm trying to debug. I attach visual studio to the sqlserver process and begin stepping through, but it keeps crashing and ending with the following error message: .NET Framework execution was…
tuseau
  • 1,334
  • 4
  • 17
  • 37
4
votes
3 answers

SQL Server CLR stored procedures in data processing tasks - good or evil?

In short - is it a good design solution to implement most of the business logic in CLR stored procedures? I have read much about them recently but I can't figure out when they should be used, what are the best practices, are they good enough or…
Gart
  • 2,297
  • 1
  • 28
  • 36
3
votes
2 answers

CLR Stored Procedure needs a Sql Server execution thread

I've a CLR trigger, which calls a Stored Procedure with BeginInvoke. In the Stored Procedure I try to call an SqlComman, but I get: The requested operation requires a Sql Server execution thread. The current thread was started by user code or other…
Aaaaaaaa
  • 2,015
  • 3
  • 22
  • 40
3
votes
1 answer

Is it possible to use Log4Net to write to log file within a CLR Stored Procedure?

Issue: Unable to debug (write) to a Log File using Log4net inside of a CLR Stored Procedure. Possibly a problem with the way I'm building the CLR project? I'm only importing the DLL's into sql server (create assembly....). Do I need to import…
3
votes
2 answers

SQL Server - CLR stored proc in scalar function as filter not weighted properly in query optimizer ==> BAD EXECUTION PLAN

I have a query that looks like the following: SELECT someString FROM ( SELECT someString FROM someTable WHERE someField = 1 ) X WHERE dbo.fnMyClrScalarFunction(X.someString) = 0 The problem is that the query optimizer is moving the UDF…
3
votes
1 answer

ms sql call stored procedure with date time parameter

how do one call a stored procedure that has date input . spName getDate() does not work. the question is about calling within ms sql managment studio.
none
  • 4,669
  • 14
  • 62
  • 102
1
2 3 4 5 6 7