1

I have a CLR stored procedure I wrote and in the database connection string in the Visual Studio project it's pointing to "localhost". This works fine when I was developing on my machine.

Now it has to be deployed to multiple SQL Server cluster instances. I deployed it to one as a test and I'm a little confused as to why it works. When you're on the cluster, trying to connect a query window to "localhost" times out and that makes sense since it's a cluster. However, the CLR stored procedure works fine.

I would have thought I would have had to use the cluster instance name in Visual Studio and re-build the .dll

My question is, is the connection string from Visual Studio in a CLR stored procedure even used after you deploy it to a server?

Thanks in advance.

2
  • I would think it is in the general sense. But the question is: does /your/ proc do anything with it? That is, what does it do with the connection once it's created? Commented Mar 8, 2014 at 13:40
  • I don't explicitly do anything with it, I use "context connection=true" when I fetch data. That's what I'm wondering, if "context connection=true" just means whatever server the proc is deployed on. Thanks to your comment, I worded the question differently and was able to find the answer. See below. Commented Mar 9, 2014 at 16:24

1 Answer 1

1

http://technet.microsoft.com/en-us/library/ms131053.aspx

Seems that's the case. "context connection=true" means in the context of the connection the CLR proc was called from and has nothing to do with the connection string in the Visual Studio project.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, this is exactly what the context_connection is for.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.