/****** Script do comando SelectTopNRows de SSMS  ******/
SELECT TOP (1000)

	CONCAT ( 'UPDATE OR insert into TBGRADE (CODIGO, DESCRICAO, T01, T02, T03, T04, T05, T06, T07, T08, T09, T10, TOTAL_TAMANHOS, STATUS, STATUSEXCLUSAO, USUARIO_CODIGO, DATA) values ('
	  ,[id],','''
      ,[Descricao],''','''
      ,[Tam01],''','''
      ,[Tam02],''','''
      ,[Tam03],''','''
      ,[Tam04],''','''
      ,[Tam05],''','''
      ,[Tam06],''','''
      ,[Tam07],''','''
      ,[Tam08],''','''
      ,[Tam09],''','''
      ,[Tam10],''',0,1,0,186,current_date) matching (CODIGO); '
	  )
  FROM [Alphaind].[dbo].[TiposdeGrade]