Locking in stored procedures If a stored procedure has multiple statements, will the lock acquired for the first statement be released once its executed or will it hold on till entire stored procedure is complete?

I am running a stored procedure under transaction from Entity Framework. Invoking the same stored procedure multiple times simultaneously is causing deadlock. The stored procedure selects a bunch of records from a table and inserts back into same table and moves on to next table. For some tables, it makes join with previous table to get the list of records to be inserted.

The stored procedure doesn't have any transaction but the call from application routed via Entity Framework has a transaction
My understanding of this is that, yes, under a transaction your SP will hold locks for the duration of the transaction. (Note there are lots of types of locks - SQL Server could row lock, table lock, page lock etc)

One SP being called simultaneously (with no other activity on your DB) causing deadlocks suggests one thing to me: the SP is not locking the same things in the same order on each call. Do you have IF blocks that perform actions on a table if a condition is met? You may wish to rewrite those to make the IF condition appear in the WHERE condition instead. This will ensure the SP locks the same resources in the same order each time.