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)
 SQL Questions Easy (not4me)

Author  Topic 

HRahman
Starting Member

1 Post

Posted - 2002-01-31 : 20:41:53
Hi, I have a few sql questions.

1) I want to update the field of one table after a user enters something in a another tabele. e.g.

In the Products table there is field called stock count. I want this field to be decremented after a field called quantity sold is updated in the sales order table.

2) How can you restrict/check that a user has enterd a valid id number. e.g.

I have a customer table, which has a key field called customer number. When sales order information is enterd in the sales order table, there is a customer number field whcih needs to be also entered. How can I check that a user has entered a customer that exists in the customer table?

Thank you very much.

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2002-01-31 : 20:45:18
1) You need a trigger...
2) You need a Foreign Key....

All these are extensively covered in BOL (Books on Line).. It is the SQL Server help file....

HTH

DavidM

Tomorrow is the same day as Today was the day before.
Go to Top of Page
   

- Advertisement -