Forum Discussion
CamTheLegend
Sep 02, 2024Copper Contributor
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 ...
- Sep 03, 2024Hello
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
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
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
- CamTheLegendSep 05, 2024Copper Contributor
Javier_Villegas Thanks for your insights. I like the @@SERVERNAME idea as a passive solution that I think will help. I'm also more aware now, so the odds are much lower based on on past experience. I always use BEGIN TRANSACTION and a --COMMIT that is commented until I check that the update was successful.