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
 SQL Server Development (2000)
 Trigger in SQL 2000

Author  Topic 

dim1962
Starting Member

1 Post

Posted - 2010-10-20 : 15:33:58
Hi All,

I never created a SQL trigger but I found it very practical.
Please help me to learn it using this example:

I have a database in SQL2000 with two tables A and B.
The fields in table A are aID, a1, and a2.
The fields in table B are bID, b1 and b2
The field aID is link with field bID (one to one)
I need a SQL trigger, which automatically update the field b1 with the same value which was entered for a1.
In others words when a user insert or modify the value a1 from table A, automatically the field b1 from table B will have the same value as a1.

Thanks a lot

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-20 : 15:35:05
Show us what you have so far.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-10-20 : 16:29:12
Homework?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-10-20 : 16:50:42
If it's homework, then the OP needs to find another school as SQL Server 2000 is not a good choice for learning at this point.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -