Skip to content

Instantly share code, notes, and snippets.

@BryanWilhite
Created November 12, 2014 23:51
Show Gist options
  • Save BryanWilhite/5b6d4f49ed020465d1cc to your computer and use it in GitHub Desktop.
Save BryanWilhite/5b6d4f49ed020465d1cc to your computer and use it in GitHub Desktop.
tSQL: CREATE TABLE with PRIMARY KEY
/*
-- 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