Oh wow, that is a pretty large question and entire books have been wrote on it. The following explination is from
Beginning SQL Server 2005 Programming by Robert Vieira - Chapter 5
(You will place this code in a query window)
The first part of creating a table is pretty much the same as creating any object â remember that line I showed you? Well, here it is again:
CREATE <object type> <object name>
Since a table is what we want, we can be more specific:
CREATE TABLE Customers
With CREATE DATABASE, we could have stopped with just these first three keywords, and it would have built the database based on the guidelines established in the model database. With tables however, there is no model, so we need to provide some more specifics in the form of columns, datatypes, and special operators.
Let's look at more extended syntax:
CREATE TABLE [database_name.[owner].]table_name (<column name> <data type>
[[DEFAULT <constant expression>]
|[IDENTITY [(seed, increment) [NOT FOR REPLICATION]]]] [ROWGUIDCOL]
[COLLATE <collation name>]
[NULL|NOT NULL]
[<column constraints>]
|[column_name AS computed_column_expression]
|[<table_constraint>]
[,...n]
)
[ON {<filegroup>|DEFAULT}]
[TEXTIMAGE_ON {<filegroup>|DEFAULT}]
Now that's a handful â and it still has sections taken out of it for simplicity's sake! As usual, let's look at the parts, starting with the second line (we've already seen the top line).
Alternatively you can use the Management Studio and right click on the 'Tables' folder underneath your database and select 'New Table'
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
================================================== =========