Click here to Skip to main content
15,886,873 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Pin
Boycech4-May-04 5:18
Boycech4-May-04 5:18 
GeneralRe: SQL Pin
talamar10-May-04 15:46
talamar10-May-04 15:46 
GeneralCreate an Access Database at runtime Pin
bsargos29-Apr-04 4:55
bsargos29-Apr-04 4:55 
GeneralRe: Create an Access Database at runtime Pin
BadJerry29-Apr-04 5:13
BadJerry29-Apr-04 5:13 
GeneralRe: Create an Access Database at runtime Pin
Santanu Lahiri29-Apr-04 10:24
Santanu Lahiri29-Apr-04 10:24 
GeneralRe: Create an Access Database at runtime Pin
Santanu Lahiri30-Apr-04 5:55
Santanu Lahiri30-Apr-04 5:55 
GeneralSage Accounting Version 10 Pin
Kryptos Sol29-Apr-04 4:43
Kryptos Sol29-Apr-04 4:43 
Generalexec two stored procedure in a main stored procedure Pin
manasrahfantom29-Apr-04 2:27
manasrahfantom29-Apr-04 2:27 
Hi there

i have a stored procedure like this:

CREATE PROCEDURE SP_Main

AS
SET NOCOUNT ON

BEGIN TRANSACTION

exec SP_Sub_One output

exec SP_Sub_Two output


IF @@ERROR = 0
BEGIN
-- Success. Commit the transaction.
Commit Tran
END
ELSE
Rollback Tran

return
GO


now the problem is, when i execute the stored procedure's inside the main stored procedure, and these sub sp's has an error on it, the main stored procedure doesnt rollback the transation.

now i can put the "begin transation" in the two sub stored procedure's. The problem is

what if the first "SP_Sub_One" executed successfully, and there was error in "SP_Sub_Two"

now the "SP_Sub_One" has been executed and i cant rollback it... the error occured in the
"SP_Sub_Two" stored procedure ... so it wont run ... so there will be error in the data

how can i make a mian "BEGIN TRANSACTION" , that even it include the execution of stored procedure in it.



Thanks in advance

Mahmoud Manasrah
GeneralRe: exec two stored procedure in a main stored procedure Pin
Jeff Varszegi29-Apr-04 3:11
professionalJeff Varszegi29-Apr-04 3:11 
GeneralRe: exec two stored procedure in a main stored procedure Pin
manasrahfantom30-Apr-04 21:33
manasrahfantom30-Apr-04 21:33 
GeneralRe: exec two stored procedure in a main stored procedure Pin
Jeff Varszegi1-May-04 6:49
professionalJeff Varszegi1-May-04 6:49 
GeneralADO.NET Deletion from SQL DB problem. Pin
Member 105947128-Apr-04 19:52
Member 105947128-Apr-04 19:52 
GeneralTransferring Data Pin
ibok2328-Apr-04 5:40
ibok2328-Apr-04 5:40 
Generalcheck login exists Pin
Dpriya28-Apr-04 2:50
Dpriya28-Apr-04 2:50 
GeneralRe: check login exists Pin
Mazdak28-Apr-04 3:47
Mazdak28-Apr-04 3:47 
GeneralRe: check login exists Pin
Jeff Martin28-Apr-04 5:33
Jeff Martin28-Apr-04 5:33 
GeneralRe: check login exists Pin
Jeff Martin28-Apr-04 5:32
Jeff Martin28-Apr-04 5:32 
Generalcheck database exists Pin
Dpriya27-Apr-04 2:56
Dpriya27-Apr-04 2:56 
GeneralRe: check database exists Pin
Jeff Varszegi27-Apr-04 7:51
professionalJeff Varszegi27-Apr-04 7:51 
GeneralRe: check database exists Pin
Jeff Martin28-Apr-04 5:35
Jeff Martin28-Apr-04 5:35 
GeneralRe: check database exists Pin
Jeff Varszegi28-Apr-04 7:08
professionalJeff Varszegi28-Apr-04 7:08 
GeneralRe: check database exists Pin
Jeff Martin29-Apr-04 9:02
Jeff Martin29-Apr-04 9:02 
GeneralRe: check database exists Pin
Jeff Varszegi29-Apr-04 9:38
professionalJeff Varszegi29-Apr-04 9:38 
GeneralInstalling ole db provider for microsoft project without installing microsoft project Pin
vinay_mat26-Apr-04 20:39
vinay_mat26-Apr-04 20:39 
GeneralLinked server from SQL Server 2000 to Sybase 12 Pin
Janya26-Apr-04 14:30
Janya26-Apr-04 14:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.