Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Lookup table best design

Author  Topic 

cyberdog
Starting Member

8 Posts

Posted - 2003-02-08 : 18:46:15
I would like to incorporate 1 lookup table, but I am struggling with the fact that "tblBrands" is created before a "tblCollections" and "tblSeries" is always created last. But I don't think referencing each table twice is wise. Any thoughts would be appreciated!

See tables below...

CREATE TABLE [dbo].[tblWebAccounts] (
[webID] [int] IDENTITY (1, 1) NOT NULL,
[webSiteName] [varchar] (64) NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblCategories] (
[catID] [int] IDENTITY (1, 1) NOT NULL,
[catName] [varchar] (64) NOT NULL,
[Description] [varchar] (4000) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblBrands] (
[bID] [int] IDENTITY (1, 1) NOT NULL,
[catID] [int] NULL,
[brandName] [varchar] (64) NOT NULL,
[Description] [varchar] (4000) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblCollections] (
[cID] [int] IDENTITY (1, 1) NOT NULL,
[bID] [int] NULL,
[cName] [varchar] (64) NOT NULL,
[Description] [varchar] (4000) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblSeries] (
[sID] [int] IDENTITY (1, 1) NOT NULL,
[refID] [int] NOT NULL,
[sName] [varchar] (64) NOT NULL,
[Description] [varchar] (4000) NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[tblLookup] (
[refID] [int] IDENTITY (1, 1) NOT NULL,
[webID] [int] NOT NULL,
[catID] [int] NOT NULL,
[bID] [int] NOT NULL,
[cID] [int] DEFAULT 0,
[sID] [int] NULL
) ON [PRIMARY]
GO

Thanks!

Cj

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2003-02-09 : 17:40:41
hi cyberdog (e-woof)

can you explain your problem a little more? I can't see what's wrong with what you have...perhaps a brief explanation of what you're doing?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -