Lookup Dillema

Lookup Dillema

Post by Jaso » Fri, 01 Nov 2002 01:27:03



I have an ASP page that builds a form of text boxes and
list boxes based on a database table.  I have populated
the list boxes with the related data using one lookup
table.

I populated the lookup table data manually using the data
of multiple lookups.  It makes it easy to get all
available list items for all list boxes in one stored
proc.  The downside is that I would have to maintain the
orginal lookup table and make sure that data is in sync
with the lookup used to populate all list boxes.

My question is - is it possible to use one stored proc to
get all the lookup data from my original lookup tables in
order to populate my list boxes without manually creating
the ListValues lookup?   I hope this makes sense.

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[FK_Company_Code_Code]') and
OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[Company_Code] DROP CONSTRAINT
FK_Company_Code_Code
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[FK_ListValues_Code]') and OBJECTPROPERTY
(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[ListValues] DROP CONSTRAINT
FK_ListValues_Code
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[ListValues]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[ListValues]
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Code]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[Code]
GO

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Company_Code]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[Company_Code]
GO

CREATE TABLE [dbo].[ListValues] (
        [ListId] [int] IDENTITY (1, 1) NOT NULL ,
        [CodeId] [int] NOT NULL ,
        [ListDesc] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Code] (
        [CodeId] [int] IDENTITY (1, 1) NOT NULL ,
        [CodeDesc] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
        [CodeType] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
        [CodeControlName] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Company_Code] (
        [CompId] [int] NOT NULL ,
        [CodeId] [int] NOT NULL ,
        [CodeVal] [varchar] (25) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

 
 
 

1. Database Dillema

Hi my name is Robert P. (please excuse my english is not that good)

I have a small office using a 486 50mhz. Netware server I have a payroll
program that was made in Clipper around 8 years ago, I don't have the
source code so i can made changes to the sistem, I need to update the
program but I don't want to use Clipper, I want to use a better DBMS
that can allow me to create a faster better aplication using my present
Databse, I dont want to throught my Database that is almost 8 megabytes
long.

I want to Use Informix but then I have to change from Novell to UNIX,
And then I won't be able to use windows 95 on the stations.

Can you give me some advice?

Thanks in advance

Robert.

2. Chief Architect (fsin19),WILMINGTON,DE

3. Lookup Behavior When Lookup Table is Empty

4. Hiding Data Structures

5. Multiple Lookups to the Same Lookup Table

6. SQL Server Service Manager Setting Question

7. DTS, Lookups--Using a lookup in a DTS transform

8. NY-FINANCIALS DBA

9. Lookup Tables to Lookup Tables

10. is it possible to lookup a field value, based on a lookup that is based on another lookup, in a repeating field?

11. HELP!!! PLEASE!!! Userdoc dillema