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 Tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-01-22 : 08:39:50
Randall Walrond writes "We have a customers database called CUSTOMERS with the following columns: Firstname, Lastname, Address, City, State, Zip Code. Whenever we add a user (which may be a bulk insert) we want to have the State also added to another table called CUSTOMER_STATES so instead of doing a 'Select Distinct State from CUSTOMERS' which may become time consuming with millions of records we can just do a 'Select * From CUSTOMER_STATES' to see a list of all of the states where we currently have customers. When a customer is deleted from the CUSTOMERS table we will then need a mechanism to check if this is the last customer for that state and if they are delete their state from the CUSTOMER_STATES table.

We are looking for a mechanism to achieve the above without severe impact on the database server's performance.

Does SQL Server 7 or 2000 have any mechanism to achieve this efficiently?

Thanks in advance,
Randall"
   

- Advertisement -