IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[drop_temp_table]') AND type = 'P')
DROP PROCEDURE [dbo].[drop_temp_table]
GO

create  procedure [dbo].[drop_temp_table]
(
@tablename varchar(100) 
)
as
set nocount on
-- lxp marke 
if (Object_Id('tempdb.dbo.'+@tablename) is not null)  
begin
  execute('drop table '+@tablename)
end
set nocount off