Lads,
Im trying build a SP that will take 6 params, put four of which into one table, and the other table then is inherited from the first table so i need to take the identity (primary key) from the first table and intpu it into my second table.
I was hoping to do this using the input/output functions but im not getting anywhere with it! well no, i am getiing somewhere ive just got one small error with my code.
create proc Register_individual @address varchar(20), @town varchar(20), @county varchar(20), @phone varchar(20), @fname varchar(20), @lname varchar(20)
as
insert into customer values(@address, @town, @county, @phone)
declare @cust_ID int
select @cust_ID = (select output inserted.Customer_ID)
insert into individual values(@cust_ID, @fname, @lname)
Im getting the following error:
" Msg 102, Level 15, State 1, Procedure Register_individual, Line 8
Incorrect syntax near '.'. "
Can someone please hint me in the right direction?