Difference between Alter and Update SQL
ALTER
is a DDL (Data Definition Language) statement. Whereas UPDATE
is a DML (Data Manipulation Language) statement. ALTER
is used to update the structure of the table (add/remove field/index etc). Whereas UPDATE
is used to update data.
ALTER
is used to change things like table structures or stored procs, otherwise known as DDL statements.
ALTER table MyTable
ADD MyNewColumn VARCHAR(100)
OR
ALTER PROC dbo.MyStoredProc
The ALTER
changes the table in the database, you can add or remove columns, etc. But it does not change data (except in the dropped or added columns of course).
While the UPDATE
changes the rows in the table, and leaves the table unchanged.