Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replicate data entered in one table to another 1

Status
Not open for further replies.

noslo

Programmer
Dec 10, 2001
24
0
0
US
I am new to SQL server 2000. I have the Customer_Id column in several tables inthe database. How do I get this data to replicate/cascade to the other tables containing this column?

Any help is appreciated.

 
If you are talking about cascade updates etc you would create a relationship between the customerid where it is the primary key in one table and a foriegn key in another table. The easiest way to handle it (In my opinion) is to create a diagram and drag your primary key into your foriegn key tables and it will create the relationships for you. Although I would also mention that it is not very difficult in table design view to open the relationships (one of the buttons on the bar should have a flyout that says relationships) and add the relationship between the two tables.

When creating the relationships you are able to select from a series of options such as cascade update etc. Although personally I would advise caution in using the new built in cascade delete functionality in 2000. I just always like the idea of having to programmatically handle cascade deletes, it makes sure that you actually want that type of thing to happen (a cascade delete can remove a lot of data you might not want removed).


Hope this helps Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Thanks for the help and the quick response. I'll give it a shot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top