-
what is wrong with my tables
Hi all: I run this table an got error
Column or parameter #4: Cannot specify a column width on data type int.
why??
/* test for existence of table; drop it if exists */
if exists
(select * from sysobjects where id = object_id(N'[Categories]')
and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [Categories]
GO
/* This table depends on SITES */
CREATE TABLE Categories
(
CategoryID int IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
SiteID int FOREIGN KEY (SiteID) REFERENCES Sites(SiteID),
CategoryName VarChar(50) NOT NULL,
/* Make sure that the sort order is a number 1 - 99. But we can still order
by Alphabetical in code */
DefaultSortOrder int(2) NOT NULL CONSTRAINT CK_DefaultSortOrder CHECK
(DefaultSortOrder LIKE '[1-9]' OR
DefaultSortOrder LIKE '[1-9][0-9]')
)
GO
________
Hawaii Dispensaries
Last edited by sql; 03-06-2011 at 01:23 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|