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.
Author |
Topic |
mojam
Starting Member
5 Posts |
Posted - 2009-09-26 : 00:22:17
|
I have Created three tables1. Producti. productid int primary key,ii.productname varchar(50),iii.model varchar(20),iv.desc varchar(100)2. Purchasei. purchaseid int primary key,ii. productid int foreign key,iii.qty int,iv.rate double,v.total double3. Salei. saleid int primary key,ii. productid int foreign key,iii.qty int,iv.rate double,v. total double-- when I shall entry data into sale table, I have to ensure that sale qty would not greater than sum of the qty of purchase of any specific product-- I have to calculate the balance sheet Pls help |
|
Kabila
Starting Member
33 Posts |
Posted - 2009-09-26 : 03:18:35
|
Use Trigger to Validate the Condition in the Sales table |
|
|
mojam
Starting Member
5 Posts |
Posted - 2009-09-27 : 01:50:06
|
quote: Originally posted by Kabila Use Trigger to Validate the Condition in the Sales table
Thanks for your advice. I m new in sqlserver. I have tried much to create a trigger. at last i failed. can anyone kindly help me pls?????? |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2009-10-05 : 16:40:31
|
can you paste what you tried |
|
|
|
|
|