Profile

Sunday 29 May 2011

SQL : to add a column into a existing table

 Say you have a table called PART in SQL database to store all the machine parts by name, by quantity etc. Later on you realize you need additional columns to store part's serial number, and the countries they made from.
This script should do :)

ALTER TABLE dbo.PART
ADD
    [PARTSNNUM] [int] NULL,
    [PARTMADEIN][nvarchar](10) NULL