October 28, 2009 at 9:06 am
Declare GetCur Cursor For
select FirstName, LastName from dbo._XMLImport
Open GetCur
Fetch Next From GetCur Into @FirstName, @LastName,
While @@FETCH_STATUS = 0
Begin
SELECT @LeadId = convert(int,MAX(Lead__Id)) FROM Lead_
PRINT(@LeadId)
SET @TotLeadId = @LeadId + 1
SET @Lead__Id = convert(binary(8), @TotLeadId)
PRINT(@TotLeadId)
PRINT(@Lead__Id)
INSERT INTO dbo.Lead(Lead__ID, First_Name, Last_Name) values
(@Lead__Id, @FirstName, @LastName)
Fetch Next From GetCur Into @FirstName, @LastName
End
Close GetCur
Deallocate GetCur
End
Result:
91725
91726
0x000000000001664E
91725
91726
0x000000000001664E
How come the insert in not commiting on the cursor? any ideas?
October 28, 2009 at 10:15 am
Is there a trigger on the dbo.Lead table that may be causing a rollback of the transaction? Are you getting any kind of error message?
October 28, 2009 at 11:44 am
There is no trigger.
I figure out.
Thanks for replying.
October 28, 2009 at 11:52 am
CooLDBA (10/28/2009)
There is no trigger.I figure out.
Thanks for replying.
And.... what did you figure out?
October 28, 2009 at 12:55 pm
Garadin (10/28/2009)
CooLDBA (10/28/2009)
There is no trigger.I figure out.
Thanks for replying.
And.... what did you figure out?
Agreed. Forum etiquette says you should post any resolution you come up with if you have asked for help. Someone else may have a similiar problem as you and your resolution may help.
October 29, 2009 at 1:59 pm
It's to do with the code. =)
October 29, 2009 at 2:01 pm
CooLDBA (10/29/2009)
It's to do with the code. =)
Nothing this tells us, elaborate please.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply