How to create a table in sql server DB
CREATE TABLE tblMaster
(
RecID Numeric(6),
RecTitle VARCHAR(100),
RecCode VARCHAR(10) NOT NULL,
DataType Numeric (2) NOT NULL,
IsDefault Numeric (1) NOT NULL default(0),
RecDesc1 Numeric (2),
RecDesc2 VARCHAR(50),
RecDesc3 VARCHAR(50),
ReffRecId Numeric (6),
InsertedBy VARCHAR(15)not null,
InsertedOn DATE not null,
UpdatedBy VARCHAR(15) not null,
UpdatedOn DATE not null,
IsActive CHAR(1) not null DEFAULT('Y'),
PRIMARY KEY ( RecID ),
Unique(RecCode),
FOREIGN KEY(RecID) REFERENCES tblMaster(RecID)
);
No comments:
Post a Comment