Skip to content

Instantly share code, notes, and snippets.

@thierryx96
Last active November 28, 2017 21:48
Show Gist options
  • Save thierryx96/39cdfbeef46413304f49 to your computer and use it in GitHub Desktop.
Save thierryx96/39cdfbeef46413304f49 to your computer and use it in GitHub Desktop.
SQL Patterns
-- Atomic exec of a script
BEGIN TRY
BEGIN TRANSACTION
...
COMMIT TRANSACTION
END TRY
BEGIN CATCH
ROLLBACK TRANSACTION;
THROW
END CATCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment