

IF NOT EXISTS(SELECT *FROM [_columnas] WHERE[tabla]='equ_alquiler'
      AND [columna]='id_documento' AND [mostrarEnGrilla]=1 AND [ordenGrilla]=1 AND [requerido]=1 AND [tipo]='int')
BEGIN
UPDATE [_columnas] SET 
[columna] = 'id_documento'
 WHERE [tabla]='equ_alquiler'
      AND [columna]='id_documento.ot' AND [mostrarEnGrilla]=1
END
