Home » Posts tagged "sql server"

Tag Archives: sql server

Adding or Modifying a Column of a Table in SQL Server Using Command

You can add or modify columns in sql server using simple queries given below: Adding a Column to a table: ALTER TABLE Table_Name ADD NewColumnName CHAR(50) DEFAULT ” NOT NULL MODIFYING A COLUMN IN A TABLE: ALTER TABLE Table_Name ALTER COLUMN Table_Column_Name VARCHAR(50) NULL Below are the points which you need to consider before altering table column: Reducing length of column for eg. changing length of column from varchar(50) to varchar(20) will lead to data loss ie. data will be [...]

Tags: , , , ,