Inserting data
In the previous section, we have seen the CREATE
, ALTER
, and DROP TABLE
statements. Once you have created tables, you can start adding rows to the table. The best way to do so depends on the scenario. The basic SQL statements that you use to manipulate data are the following:
INSERT
UPDATE
DELETE
Together, these statements are called Data Manipulation Language (DML). We will use the regular INSERT
statement to add some data to our database:
- Open the
dbo.Customer.Table.sql
file from the downloads and execute it. The first two lines of this file are shown here:SET IDENTITY_INSERT [dbo].[Customer] ON INSERT [dbo].[Customer] ([CustomerID], [CompanyName], [ContactName], ContactTitle], [Address], [City], [Region], [PostalCode], [Country], [Phone], [Fax]) VALUES (1, N'Alfreds Futterkiste', N'Maria Anders', N&apos...