Microsoft SQL Server INSERT a single row of data


Example

A single row of data can be inserted in two ways:

INSERT INTO USERS(Id, FirstName, LastName)
VALUES (1, 'Mike', 'Jones');

Or

INSERT INTO USERS
VALUES (1, 'Mike', 'Jones');

Note that the second insert statement only allows the values in exactly the same order as the table columns whereas in the first insert, the order of the values can be changed like:

INSERT INTO USERS(FirstName, LastName, Id)
VALUES ('Mike', 'Jones', 1);