sql - select into or insert into for stored procedure -


i have stored proc transfer , manipulation 1 database another. there 8 tables in created. method

begin if table exists. begin drop table end begin select (do manipulations here, convert varchars, rename etc) newtablename [linked server].table inner join [linked server].table ec conditions end end 

i found today procedure broke on weekend, , got error saying

lock request time out period exceeded

i read due select code, should changing insert into?

or, should placing each block inside following

begin transaction; begin try     block here     commit transaction; end try begin catch rollback transaction; end catch 

cheers help


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -