Hello,
I'm trying to build a stored procedure that inserts some rows into a couple tables..we'll call them table1 and table2
The problem is I need to know the Primary ID of the record that I insert into table1 in order to insert my second record into table2..
For example I have this right now
INSERT INTO table1 (name, value) VALUES ('kag1' , 'value1')
after inserting that record do I have to SELECT it again in order to get the ID of it? (The ID is an integer that increments 1 every record)
and then after I get that ID i wanted to go like
INSERT INTO table2 (table1_ID, name, value) VALUES (@ID, 'kag1' ,' value2')
I know such a thing is possible...I just can't find out how to do it..
Thanx kag1