Database Reference
In-Depth Information
Let's work through another example in which you create a table and add data. Here are the steps:
1.
After the previous query is finished, you're back at the 1> prompt. Type
in the statement shown in Figure 6-6.
Figure 6-6. Creating a table
Press Enter, type GO on line 2> , and press Enter again, to execute the
CREATE statement.
2.
When the T-SQL command that you execute is the type that doesn't
return data, the sqlcmd utility doesn't give you back a message but
takes you to the 1> prompt. However, you can verify that a statement
executed successfully by going into SQL Server Management Studio
(SSMS), connecting to your SQL Azure instance, and expanding the
Tables node of your chosen database. Figure 6-7 shows the results from
doing that—you can see that the table was indeed created.
The table you created is called TechGeoInfo, and it has three columns: an ID column that is the
primary key (clustered index), a TechID column, and an address column. The table is simple, but it's
good enough to demonstrate functionality.
3.
Note You know from earlier in the chapter that the id column must be a primary key clustered index, or you
won't be able to add data to the table.
Search WWH ::




Custom Search