vijay nagar
vijay nagar

Reputation: 51

Assembly Configuration CLR Stored Procedure

Is it possible to have an app.config file for CLR Stored Procedures. Just so that one can specify more options in the config file?

Upvotes: 3

Views: 2041

Answers (3)

David Rodecker
David Rodecker

Reputation: 127

For SQL2008 and 2012, you can create a configuration file in /BINN folder under named exactly as sqlservr.exe.config. In SQL2014, the capability appears to be gone.

Upvotes: 2

Remus Rusanu
Remus Rusanu

Reputation: 294237

You need to place your configuration into sqlservr.exe.config, eg. Accessing Application Configuration Settings from SQL CLR. This is a bad idea though because databases are mobile, they travel with backup/restore, with detach/attach, and most importantly with HA solutions like log shipping and mirroring. The config settings are lost on each case, since the .config files does not travel along with the database.

The best solution is, as Daniel suggested, to use the quite powerful storage you have at your disposal to store configuraiton info: tables.

Upvotes: 1

Daniel A. White
Daniel A. White

Reputation: 190925

I do not think so. The process is sql server.

I would suggest creating a configuration table with the data you would need.

Upvotes: 2

Related Questions