Reputation: 51
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
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
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
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