Hi guys. I'm pretty new to sql and I'm having some trouble with a store procedure. I tried to read about it by searching goggle but all the references i got to the topic contained to complex store procedures for me and my current level :P.
Here is my simple store procedure:
CREATE PROCEDURE INCERT_HOUSEADDRESS
@postCode varchar(10),
@areaName varchar(20),
@city varchar(20),
@country varchar(20),
@houseAddressID int OUTPUT
AS
BEGIN
INSERT INTO HouseAddress VALUES(@postalCode, @areaName, @city, @country)
SELECT @houseAddressID FROM HouseAddress WHERE HouseAddress.postCode = @postCode
END
I need to get the houseAddressID so I can return it through ADO to my C# application so that I can insert Households(is a table that holds houseAddresID as a foreign key) connected to that address.