Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Enum in SQL Server

USE WorldofWarcraft;

CREATE TABLE [users]
(
   ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
   username nvarchar(255),
   password nvarchar(255),
   mail nvarchar (255),
   [rank]  nvarchar (255) NOT NULL CHECK ([rank] IN('Fresh meat', 'Intern','Janitor','Lieutenant','Supreme being')) DEFAULT 'Fresh meat'
);

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Enum #SQL #Server
ADD COMMENT
Topic
Name
4+3 =