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

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Trigger to update table

Author  Topic 

propoo
Starting Member

1 Post

Posted - 2007-11-30 : 18:02:57
Hey All

I have table Employee which has coluumns (id, name, address, ssn, DOB, date of join,level etc )employee records. Everytime there is new employee in company, there is new entry in Employee table.
I have another table User which has three columns (id, user, password) which consists name of all current employee in user column and ther password is name+123.

I want to write a trigger which automatically should update the User table with name, name +123 of new user when new employee is added to Employee table.

Do help mer in writing this,
Thanks

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-11-30 : 19:11:45
How are you doing the INSERT? via stored proc? I suggest diong the INSERT into the USers table right after the INSERT into the Employee table.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -