June 4, 2008 at 5:45 am
Hi, this might allready be described in another topic but I wasn't able to find it.
I've got a CLR stored procedure and CLR function (written in C#). The function is quite simple. It takes 2 parameters to match strings using regular expressions. I tried using the inbuilt ole extended procedure but it turns out I can't enable ole objects on production db server. So I wrote a CLR function that does the same thing. Does anyone have and statistics on how fast such a function is in compare to LIKE operator in T-Sql WHERE statements?
Anyway, I've also writen a CLR stored procedure which runs up to maximum of 80 minutes. I had some trouble debuging it since the original Visual Studio project was set up as a normal class library rather than database project. At the end I added App.config to the project and whenever a SqlConnection object is instantiated it uses the connection string defined in app.config. Since when this gets deployed to Sql Server 2005 server there is no app.config file it uses context connection in that case. A lot easier to debug this way than using a database project if you ask me.
One part of the stored procedure is particulary long. It's loging percentage completed to a console if it's runing in console application contenxt or to SqlContext.Pipe if SqlContext.IsAvailable. It's working fine in console application, outputing percentage correctly. But when I execute it withing Sql Server CLR procedure context and run the procedure it takes very long intervals to output anything and even then it outputs a chunk of percentages. It looks like there is some pooling interval for stored procedure output present. Is there any way to control this interval? Or is it possible to dissable it entirely so each stored procedure output imediatelly pops up on Messages or Results window in Management Studio?
Thanks
January 8, 2012 at 11:35 pm
Hi Ales,
First I want to see the code what you wrote... As per my understanding the contextstring has unlimited time for the execution of the command... but it is not working as mentioned.... I also worked on CLR procedures earlier where I tried contextString but it didnot work properly... so I had went for another way of doing.... If you show me your code I will try to help you out in this....
Thnks
V
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply