Class Act

Back to the shelf

SQL · Snippet · ASP.net

Create Table

A SQL CREATE TABLE script — a starting template for creating a new database table.

Example

How to use Create Table:
Run the statement in a query window on the database you want to change.

Code

CREATE TABLE [dbo].[tblOffice] (
  [officeid] [int] IDENTITY(1,1) NOT NULL,
  [name] [varchar] (40) NULL,
  [active] [bit] NULL DEFAULT ((1)),
  [created] [datetime] NULL DEFAULT (getdate())
  ) ON [PRIMARY];