Adicionar columna si no existe

IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='Entrega' AND COLUMN_NAME='Historico') BEGIN ALTER TABLE Entrega ADD Historico INT NOT NULL DEFAULT 1 END

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.