Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Jun 4, 2000

Create a New Table

Question:
How do I create a new table?

Answer:
The DLL syntax for creating a table intuitively is the CREATE TABLE command. You can specify all the options for the table that you can in Enterprise Manager, such as IDENTITY columns, primary keys, check constraints, default constraints and foreign keys.

Here's a SQL code snippet that creates a table (and for more on the CREATE TABLE syntax check the SQL Server BOL):

CREATE TABLE TestTable
(    
  ID  int
    IDENTITY(1,1)
    PRIMARY KEY CLUSTERED,
  TestDescription varchar(50) NOT NULL,
  Mileage tinyint NULL

)
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date