Adding New Data with INSERT

You can enter new data into the database by using the INSERT SQL statement. The syntax of the command is fairly simple. However, before building the query to add new data, you must know the schema of the table. Figure 3.2 shows the schema of the Categories table in the Northwind database.

Figure 3.2. The Microsoft SQL Enterprise Manager can display the schema of your database to help you build queries.

Notice that the table consists of four fields, including the CategoryID column. This field contains an integer that is automatically incremented for each new record added; we will not need to add a value with our query. ...

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.