I have a stored procedure that deletes the contents of 3 tables then re-populates those tables from an external source.
What I want to avoid is two users running the same procedure concurrently - i.e. where one user may be in the process of re-populating the tables while another (who started the same procedure a fraction of a second later) is trying to delete the content of those same tables.
Would BEGIN TRANSACTION /COMMIT TRANSACTION be enough or do I need to know/do more?
What I want to avoid is two users running the same procedure concurrently - i.e. where one user may be in the process of re-populating the tables while another (who started the same procedure a fraction of a second later) is trying to delete the content of those same tables.
Would BEGIN TRANSACTION /COMMIT TRANSACTION be enough or do I need to know/do more?