Use an output parameter from your stored procedure.
Code:
CREATE PROCEDURE MyProc
@Ret @site_id OUTPUT
AS
SELECT @site_id = @@IDENTITY
and your asp code:
Code:
Dim cmd
Set cmd = Server.CreateObject("ADODB.Command")
With cmd
.ActiveConnection = cn
.CommandType = adCmdStoredProc
.CommandText = "MyProc"
.Parameters.Append .CreateParameter("site_id", adInteger, adParamOutput)
.Execute
End With
Response.Write cmd.Parameters("site_id").Value
Set cmd = Nothing
regards
David Cameron