
Untitled
By: a guest on
Jul 1st, 2012 | syntax:
None | size: 0.43 KB | hits: 10 | expires: Never
Why is CREATE TABLE command not working in a user-defined transaction?
BEGIN TRANSACTION T1
CREATE TABLE temp
(
chisla char(1)
)
SELECT count(chisla) AS Count, chisla AS My_Numbers
FROM temp
--GROUP BY chisla
ORDER BY chisla
drop table temp
COMMIT TRANSACTION T1
GO
BEGIN TRY
BEGIN TRANSACTION
...your code...
COMMIT TRANSACTION
END TRY
BEGIN CATCH
...error reporting code here...
ROLLBACK TRANSACTION
END CATCH;