Skip to content

Instantly share code, notes, and snippets.

@erjjones
Created August 29, 2012 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erjjones/3506700 to your computer and use it in GitHub Desktop.
Save erjjones/3506700 to your computer and use it in GitHub Desktop.
Sample Contacts Table for the Get Collection Store Procedure
CREATE TABLE dbo.Contacts (
ContactID int IDENTITY (1,1) NOT NULL,
FirstName nvarchar(64) NULL,
LastName nvarchar(64) NULL,
Phone nvarchar(50) NULL,
[Address] nvarchar(128) NULL,
City nvarchar(50) NULL,
[State] nvarchar(50) NULL,
Zip nvarchar(50) NULL,
Country nvarchar(128) NULL,
Company nvarchar(64) NULL,
Website nvarchar(512) NULL,
EmailAddress nvarchar(128) NOT NULL,
IsActive bit NOT NULL CONSTRAINT DF_Contacts_IsActive DEFAULT((1)),
CreatedDate smalldatetime NOT NULL CONSTRAINT DF_Contacts_CreatedDate DEFAULT(GETDATE()),
ModifiedDate smalldatetime NOT NULL CONSTRAINT DF_Contacts_ModifiedDate DEFAULT(GETDATE()),
CONSTRAINT PK_Contacts_EmailAddress PRIMARY KEY CLUSTERED (EmailAddress)
)
CREATE UNIQUE NONCLUSTERED INDEX IX_Contacts_ContactID ON
dbo.Contacts(ContactID) INCLUDE (FirstName, IsActive)
WITH(ONLINE=ON)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment