I'm having a similar problem. Here's the code:
Declare @sql_stmt nvarchar(250)
Declare @template_name varchar (30)
Declare @table_name varchar (31)
Declare @field_name varchar (30)
set @template_name = 'hpi_oncprostate'
set @field_name = 't_dec'
set @table_name = @template_name + '_'
delete from fields_master Where field_name=...