-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: manojpro
Message 1 in Discussion
Hi ,
Please any body let me know how the control flows in this stored procedure
given below.
I want to know execution flow
In given stored procedure ,
if insert fails inside cursor, will it execute all other statements after
insert eg SELECT and FETCH
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROC
sp_TestInsert
AS
BEGIN
SET NOCOUNT ON
BEGIN TRANSACTION
DECLARE @EMPID INT
DECLARE CR_EMP CURSOR FOR
SELECT EMPID FROM EMPLOYEE
Open CR_EMP
FETCH CR_EMP INTO @EMPID
WHILE(@@fetch_status=0)
BEGIN
INSERT INTO EMPLOYEE VALUES
(1,'MANOJ','XYZ',11)
SELECT * FROM EMPLOYEE
FETCH NEXT FROM CR_EMP INTO @EMPID
CLOSE CR_EMP
DEALLOCATE CR_EMP
END
IF @@ERROR <> 0
BEGIN
ROLLBACK TRANSACTION
RETURN(0)
END
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
--
Regards,
Manoj Kulkarni
9448644188
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]