January 27, 2003 at 10:03 am
i have a table manufacturerContract with column names
manuf_contract_id
manufacturer_id
per_minute_percent
rental_percent
when_dt
emp_claimed_id
i have another table manufacturerContractItem table
manufacturer_id
company_name
contact_state
contact_country
manuf_contract_notes
contract_text
i have to do an insert statement where the manuf_contract_id is auto generated and
it so happens that when user says submit manufacturerContract table gets values manufacturer_id
per_minute_percent
rental_percent
when_dt
emp_claimed_id and then ManufacturerContractItem table gets values company_name
contact_state
contact_country
manuf_contract_notes
contract_text in the same insert statement
any help???
January 27, 2003 at 11:11 am
why in the same statement? why not 2 insert statements?
January 27, 2003 at 11:26 am
quote:
why in the same statement? why not 2 insert statements?
how can i do two inserts ???
i am sorta jumbled up
January 27, 2003 at 11:35 am
What about:
DECLARE @ContractID INT
INSERT INTO manufacturerContract
VALUES
(
@manufacturer_id, @per_minute_percent, @rental_percent, @when_dt, @emp_claimed_id
)
SET @ContractID = @@IDENTITY
INSERT INTO manufacturerContractItem
VALUES (
@ContractID, rest of fields...
)
You'll have to post some SQL code if this doesn't help...
Cheers,
Jay
January 27, 2003 at 12:03 pm
Thanx jay
You are awesome
i got it
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply