martes, 26 de noviembre de 2019

Crear un campo en caso de no existir

If Not Exists(Select * from INFORMATION_SCHEMA.COLUMNS Where COLUMN_NAME = 'MiCampo' AND TABLE_NAME = 'MiTabla')
Alter Table MiTabla Add MiCampo smallint

No hay comentarios:

Publicar un comentario