Hi, i need to drop and rename the tables during run of code. If table is exist I need drop it. How can I make a sql statement for test of existing table set @detail='Det_'+@novaTab ( @novaTab is name of table, is changing during run of code) If (Select object_id(@detail)) > 0 Set @sqlCommand='Drop Table ' +@detail Execute @sqlCommand) set @sqlCommand=' sp_rename Detail , ' + @detail (table Detail is creating on start of cycle) Execute (@sqlCommand) set @detail='' . . . I think It is need write statement @novaTab as some execute.