Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I would like to be able to build a trigger that checks the ApplicationName coming across on a transaction, and if the ApplicationName is of a certain value, then I want to throw an error, saying the user is not allowed to make this transaction.

Is there a way to create this script?

share|improve this question
add comment

1 Answer

Yes, you can use the APP_NAME() function in SQL.

This is set in the connection string though so it isn't reliable

Why not limit users? If a user has permissions, they can run msqry32 which is on any PC with Office installed, set a connection string using ODBC and make it look like what they want...

share|improve this answer
    
+1 for "isn't reliable" –  a_horse_with_no_name Feb 2 '12 at 21:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.