Forum Discussion

CamTheLegend's avatar
CamTheLegend
Copper Contributor
Sep 02, 2024
Solved

Default SQL Server Connection for SSMS

SQL 2019 - SSMS 19.3.4.0 I was always wrongly under the impression that SSMS required a server connection in the Object Explorer to run a script against.  We have databases with the same names on 2 ...
  • Javier_Villegas's avatar
    Sep 03, 2024
    Hello
    Yo cannot lock a session from SSMS. it will always go get the one from previous opened script when you do it via File -> Open

    I'll suggest you to use SELECT @@SERVERNAME to double check on which server your are, and also strongly suggest to use BEGIN TRANSACTION with COMMIT / ROLLBACK , especially when you are tunning ad-hoc scripts in production servers. this way you can revert in case of a mistake

Resources