|
-
Apr 14th, 2012, 03:08 AM
#1
Thread Starter
New Member
Need Help For SQL Trigger
Dear all mmbers and VB professionals,
=======================================
i need help in SQL Trigger :
i'm using VB 6.0 and MSSQL 2000
=======================================
Tables :
1. Stock
- code varchar(12) --->barcode
- names varhcar(50)
- qty int
2. Sale
- dos datetime --->date of sale
- code varchar(12) --->barcode
- qty int
- Price money
3. Purchase
- dop datetime ---> date of purchased
- code varchar(12) --->barcode
- qty int
- price money
3a. Purchase_Log
- dop datetime ---> date of purchased
- code varchar(12) --->barcode
- qty int
- price money
=======================================
Conditions :
* Purchase
if code not found in stock then "Addnew" in stock table with a complete data (barcode,item name,qty)
else
if found then just update stock qty = qty + purchase.qty
also INSERT INTO table "Purchase_Log"
* Sale
same condition
=======================================
Thank you very much for your help.
=======================================
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|