Extended Search
Babakov.Net
Home Contacts Rules
  • Login
    Registration Forgot password?
Home Contacts Rules
  • Algorithms 0
  • Programming 2
    • C++ 0
    • .NET C# 2
    • Python 0
    • Java Script 0
  • Databases 12
    • MSSQL 10
    • Oracle 2
    • MySQL 0
  • Design 0
  • Any stuff 2
Software Developer Blogs & Notes » Tag cloud » transaction
Home

Geting current SESSION ID and TRANSACTION ID.

To get current SESSION ID:

select @@spid


To get current TRANSACTION ID:

select CURRENT_TRANSACTION_ID()
Databases / MSSQL
Read more
0
  • complaint
  • 11
  • 0
  • Roman from 5-09-2023, 13:11

Two options for executing transaction in MSSQL, each rollback by error

Two options for executing transaction in MSSQL, each rollback by error.

First option:

BEGIN TRY
    BEGIN TRAN
    UPDATE 1
    UPDATE 2 --Error
    UPDATE 3
    COMMIT TRAN
END TRY
BEGIN CATCH
    ROLLBACK TRAN
END CATCH
Databases / MSSQL
Read more
0
  • complaint
  • 2
  • 0
  • Roman from 4-09-2023, 13:01

Popular articles

  1. An example of selecting a range of dates in MSSQL MSSQL
  2. Example, how to cath error in MSSQL MSSQL
  3. An example searching of procedure by text it contain MSSQL

Tags Cloud

C# catalog catch cmdshell config date dynamic error fetch folder ftp ftpd interpolated string join linux mssql numbers oracle procedure range restart rollback rows sequence serch session sevice sql string stuff text top transaction tsql ubunu update version XDocument xml xp_cmdshell
Show all tags
  • Categories
    Advanced search Latest articles Latest comments Mobile version of Website
  • Customers
    Homepage Rules Registration Statistics
  • Socials
    Telegram
Copyright © 2005–2023 Babakov.Net All Rights Reserved. Powered by Babakov Roman © 2023