There are several ways of getting the value of newly inserted id. On is as Mark wrote use the scope identity. Your procedure would look something like:
create procedure p_dd(@P_name varchar(40),@P_address varchar(40),@P_id int output )
as
begin
insert into mytbel (name,address)
values (@P_name,@P_address);
set @P_id = scope_identity();
end
Another way is to get the actual value from the insert statement using OUTPUT clause. for example:
create procedure p_dd(@P_name varchar(40),@P_address varchar(40),@P_id int output )
as
begin
insert into mytbel (name,address)
output inserted.id into @P_id
values (@P_name,@P_address);
end