Click to See Complete Forum and Search --> : returning identity from stored procedure


esthera
09-15-2005, 06:11 AM
can someone help me?
I have a stored procedure and i'm trying to return the identity

I finally got it working in query analyzer but when I put the exact query that returns a record in query analyzer into a variable sql and then do
set rs=objconn.execute(sql)
myid=rs(0)

myid is blank

What can I do??

my code (which works in sql query analyzer but is not returning the record through ado) is

DECLARE @MyIdentity INT exec spinsertuser @firstname='xxx',@lastname='xxx',@email='ssfasd@.dfjkasdj.dfasd',@address='xxjkjkjkl',@city='xxxx',@ state='ID',@zip='34343',@home_phone='3432223423',@home_phone_ext=null,@work_phone='4343243242',@work _phone_ext=Null,@MyIdentity =@MyIdentity OUTPUT SELECT @MyIdentity as ident

esthera
09-15-2005, 09:30 AM
figured it out myself