Home > Archive > microsoft.public.cert.mcdba > August 2003 > What is wrong with this SQL statement (Transaction)?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author What is wrong with this SQL statement (Transaction)?
CHJUNG

2003-08-20, 5:24 am


>-----Original Message-----
>I'm wondering what is wrong with the statements below.

I'm sure I'm missing
>something...
>
>begin tran myTransaction
>
>--my SQL works here.
>
>rollback tran myTransaction
>
>---------
>Error
>
>Server: Msg 6401, Level 16, State 1, Line 5
>Cannot roll back myTransaction. No transaction or

savepoint of that name was
>found.
>
>--------
>
>Thanks!
>Tomtom
>
>
>.
>

TRY THIS CODE ....

DECLARE @TranName VARCHAR(20)
SELECT @TranName = 'myTransaction'

BEGIN TRANSACTION @TranName

YOUR SQL STATEMENT

COMMIT TRANSACTION myTransaction
GO

Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net