I wanted to insert the result of stored procedure into the temporary table.how to achieve it ?
The below is my Stored procedure.I am new to Sp.
ALTER procedure [dbo].[insertpropertylisting]
@propertyname varchar(150),
@propertyaddress varchar(250),
@propertyprice money,
@availableunits varchar(100),
@propertyid int OUTPUT
as
BEGIN
insert into propertylisting(propertyname,propertyaddress,propertyprice,availableunits)
values(@propertyname,@propertyaddress,@propertyprice,@availableunits)
print @propertyname
select @propertyaddress as 'address'
SET @propertyid=SCOPE_IDENTITY()
SELECT @propertyname=propertyname,@propertyaddress=propertyaddress,@propertyprice=propertyprice,
@availableunits=availableunits
FROM propertylisting
WHERE property_id=@propertyid
Return @propertyid
END