Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql logon

Status
Not open for further replies.

neilsie

Technical User
Jan 31, 2002
15
0
0
GB
Hi guys, just wondering if:

1. Can Sql Server do logon triggers?
2. Can I store session variables e.g. when a user logs on, select a value from a table and store that somewhere in memory so i can use it in other select statements...
3) Do dynamic sql within a view?

thanks for any help.
 
In answer to number two, what we do is use the user interface to store session variables and use them to populate the parameters in stored procedures called later.

For number three, no you can't use Dynamic SQL in a view, but you can in a stored procedure. I would write the code you want in a stored procedure and call that from your user interface. There are disadvantages to using dynamic SQL mainly in the area of security as you must then set security at the table vice the stored procedure level.

Not sure what you want checked at login, but I would have it done by your user interface vice a trigger. I would not allow any users beyong dbas and development staff to have access to a database except through a stored procedure. But if you specify what you wanted to do on login maybe we can help more.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top