Answers for "sql server add a column to an existing table not working"

SQL
16

sqlserver add column to table

ALTER TABLE dbo.doc_exa 
ADD column_b VARCHAR(20) NULL, 
	column_c INT NULL ;
Posted by: Guest on April-08-2020
0

sql alter table add column if exists

IF NOT EXISTS (
  SELECT
    *
  FROM
    INFORMATION_SCHEMA.COLUMNS
  WHERE
    TABLE_NAME = 'table_name' AND COLUMN_NAME = 'col_name')
BEGIN
  ALTER TABLE table_name
    ADD col_name data_type NULL
END;
Posted by: Guest on May-07-2021

Code answers related to "sql server add a column to an existing table not working"

Code answers related to "SQL"

Browse Popular Code Answers by Language