Correct way to execute 2 SQL commands without other command executing in between
问题 The suggested duplicate doesn't answer the question in the title. I want to execute two MSSQL commands without any other "user" (I'm not sure what's the correct term) executing a command between them. Searching, I have found two ways that seem like they would achieve that but am unsure about them: Use TABLOCK. - But I've seen it being considered bad practice. Use a transaction - But all I could find was that it will be atomic, and not necessarily locking out other actions. What way is the