Created
November 12, 2014 23:51
-
-
Save BryanWilhite/5b6d4f49ed020465d1cc to your computer and use it in GitHub Desktop.
tSQL: CREATE TABLE with PRIMARY KEY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
-- Update: | |
IF EXISTS | |
( | |
SELECT * FROM sysobjects | |
WHERE | |
name = 'Fragment' | |
AND | |
type = 'U' | |
) | |
DROP TABLE [dbo].[Fragment] | |
*/ | |
CREATE TABLE [dbo].[Fragment] | |
( | |
[FragmentId] [int] IDENTITY (1, 1) NOT NULL | |
, [InceptDate] [datetime] NOT NULL | |
, [ModificationDate] [datetime] NOT NULL | |
, [FragmentName] [varchar](64) NULL | |
, [FragmentDisplayName] [varchar](255) NULL | |
, [FragmentContent] [varchar](max) NULL | |
, [IsActive] [bit] NULL | |
, [SortOrdinal] [tinyint] NULL | |
, CONSTRAINT [PkFragment] PRIMARY KEY CLUSTERED([FragmentId] ASC) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment