copy column from table to table with condition : ALTER proc [dbo].[Timesheet_update]
as
begin
  declare @sql2 nvarchar(max),@status nvarchar(1)
  set @sql2='insert into s21022020 (s21_stfno) select m_stfno from master where m_status<>'D''
  execute (@sql2)
end
execute Timesheet_update
Msg 207, Level 16, State 1, Line 23
Invalid column name 'D'.

m_status column contain data =D
