Need tips to optimize SQL Server stored procedure -
this stored procedure, it's taking time execute though running local database. please suggest changes in order improve performance begin try declare @country_cd int set @country_cd =(select country_cd country country_desc = ltrim(rtrim(@country_desc))) declare @companny_cd int set @companny_cd =(select company_cd company company_desc = ltrim(rtrim(@company_desc))) begin transaction delete pack country_cd = @country_cd , company_cd = @companny_cd , pack_desc = ltrim(rtrim(@pack_desc)) commit transaction end try begin catch if(@@trancount > 0) rollback transaction declare @errmsg nvarchar(4000), @errseverity int select @errmsg = error_message(),@errseverity = error_severity() raiserror(@errmsg, @errseverity, 1) end catch hard without knowing more database schema. few initial ideas might cleanup *_desc variables right away rather doin