I am using context connection in the sqlclr (and there are reasons to do so). While a datareader is under execution that uses the context connection, I need another database read passing one of values being read from the datareader. Since I cann't use the
context connection for this second read (as context connection is already in use), how can I create a second connection to be used with this second read. I cannot create the hardcoded connections string for the second connection as the database is dynamically
selected. The database is same as used by the context connection. I can use the server=localhost though, but cannot hardcode the database name as the database can be different in different sqlclr proc call. However the database is same as used by the context
(If I somehow get the database name from the context connection then I can use it to create another connection, but I am expecting an even better solution)
Any solution to this problem? Will be very thankful.
View Complete Post