Using SqlTransaction with SqlCommandType = StoredProcedure

teixeira

Well-known member
Joined
Apr 5, 2005
Messages
94
Location
LEIRIA-PORTUGAL
Hello,

Is it possible to make an SqlTransaction having a strored procedure as my sqlcommandtext ?

In the examples ive seen people just use transactions with sqlcommandtext containing UPDATE, DELETE or INSERT code.

Is it possible?

TIA,
 
There is no reason at all why you cant use a stored proc as part of a SqlTransaction.

The only thing you might need to be careful about is if the stored proc itself also begins its own transactions.
 
Hi,

It starst its own transactions, but if we specify that syntax inside the procedure use T-SQL "Transaction" reserved word, right? or it starts an implicit transaction in any SP we create even we dont use explicitly declare de T-SQL "Transaction" reserved word?

Best regards,
Tiago Teixeira
 
Back
Top