EnVisageOnline/Main-RMO/Database/Schema/Tables/dbo.Contact.sql

20 lines
2.0 KiB
Transact-SQL
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Run this script on SQL Server 2008 or later. There may be flaws if running on earlier versions of SQL Server.
*/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Contact]') AND type in (N'U'))
DROP TABLE [dbo].[Contact]
GO
CREATE TABLE [dbo].[Contact] (
[Id] [uniqueidentifier] NOT NULL CONSTRAINT [DF_Contact_Id] DEFAULT (newid()),
[Type] [int] NULL,
[LastName] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FirstName] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MiddleInt] [char](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Email] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Phone] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ParentId] [uniqueidentifier] NULL,
[ContactClassification] [int] NOT NULL CONSTRAINT [DF_Contact_ContactClassification] DEFAULT ((0)),
CONSTRAINT [PK_Contact] PRIMARY KEY CLUSTERED ([Id])
) ON [PRIMARY]
GO