Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Trigger on user basis
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic
Aged Yak Warrior

549 Posts

Posted - 01/12/2011 :  23:57:18  Show Profile  Reply with Quote
Hi All,

I have a table with frequent update by 2 sources.
One is by front end application user(webuser) he will update records
and another one is batch job which runs with other user name(sam) updates dially.

I need to have update trigger to fire (Update trigger will update the self table flag to indicate this update has done by webuser) only when update done by webuser not the batch job.

How do we do this in SQL server 2005 ?

Gangadhara MS
SQL Developer and DBA


5072 Posts

Posted - 01/13/2011 :  08:49:23  Show Profile  Visit russell's Homepage  Reply with Quote
Use SYSTEM_USER, HOST_NAME, or APP_NAME in your trigger.

Execute this query to see what I mean
select SYSTEM_USER, host_name(), APP_NAME(), user_name()
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000