Link to home
Start Free TrialLog in
Avatar of CAMSYSTEMS
CAMSYSTEMSFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL Function to get attributes from a connectionstring

Is there anyway that SQL Server 2005 can get information contained within the ConnectionString that was used to connect to the database for use in a trigger.

For example, if I have an application that uses the ConnectionString...
"server=(local); database=test; user=sa; pwd=testing; applicationname=myprogram"

how can I get out the applicationname attribute???
Avatar of YZlat
YZlat
Flag of United States of America image

what exactly are you trying to do here??

From what I can see so far, you can't do that
what exactly are you trying to do here??

From what I can see so far, you can't do that
ASKER CERTIFIED SOLUTION
Avatar of ksaul
ksaul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CAMSYSTEMS

ASKER

All I want to do is to be able to extract the applicationname attribute from the connectionstring that has been used to connect to the database from within SQL Server 2005???
Avatar of ksaul
ksaul

I would create a SQL login specific to the application instead of using sa and assign it permissions required by the app.  Then you could know that the value returned by current_user is your application.