Alter Table Add Column on SQL Server
If you try running this command to add a new column on Microsoft SQLServer:
ALTER TABLE ADD COLUMN column_name int
You will get an error message:
Incorrect syntax near the keyword 'COLUMN'.
That's because SQL Server Doesn't like ADD COLUMN
it prefers you just say ADD
instead:
ALTER TABLE ADD column_name int
Like this? Follow me ↯
Tweet Follow @pfreitagAlter Table Add Column on SQL Server was first published on March 24, 2009.
If you like reading about sqlserver, or sql then you might also like:
- Order by NULL Values in MySQL, Postgresql and SQL Server
- SQL Case Statement
- Getting ColdFusion SQL Statements from SQL Server Trace
- Try Catch for SQLServer T-SQL
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
- Backwards LIKE Statements
- SQL to Select a random row from a database table
- Temporary Stored Procedures on SQL Server