/****** Script do comando SelectTopNRows de SSMS  ******/
SELECT concat('UPDATE OR insert into TBMODELO_LINHA (CODIGO, DESCRICAO, FAMILIA_CODIGO, STATUSEXCLUSAO)',
'values (',
		
		[Codigo],','''
      ,[Descricao],''',',
	  '299,0) matching (CODIGO); ') as SQL

  FROM [Alphaind].[dbo].[Linhas] a