Re: Is there a quick way to copy database information? On Oct 13, 4:10 am, strawberry <zac.ca...@gmail.com> wrote:
> On 13 Oct, 09:16, "Paul Lautman" <paul.laut...@btinternet.com> wrote:
>
>
>
> > nino9st...@yahoo.com wrote:
> > > Hello,
>
> > > I have tried searching for this subject, but can never seem to find
> > > exactly what I'm looking for. Here is the situation I have at hand.
>
> > > I want to find a quick (hopefully painless) way to copy information
> > > that I have stored in the database. Here is how the information is
> > > stored:
>
> > > TABLE: LeagueInfo
> > > league_id auto_increment primary key
> > > league_name, etc...
>
> > > TABLE: Teams
> > > team_id auto_increment primary key,
> > > teams_league_id (ties to LeagueInfo's league_id)
> > > team_name, etc...
>
> > > TABLE: Players
> > > players_id auto_increment primary key
> > > players_team_id (ties to Teams' team_id)
> > > players_name, etc...
>
> > > TABLE: Stats
> > > stats_id auto_increment primary key
> > > stats_player_id (ties to Players' player_id)
> > > stats_game_id, etc
>
> > > Since a lot of the information provided is tied to each other, how can
> > > I ensure that when I "duplicate" the entire league, all the
> > > appropriate ties stay consistent, and all the new copied information
> > > will have the appropriate new auto_incremented fields. For example:
>
> > > If I have a league called Football League with 2 teams (Team1 and
> > > Team2), and they have 5 players each with varying rows of stats for
> > > each player, how can I ensure that the new league (let's call it
> > > Basketball League) will easily duplicate all the information.
>
> > > The reason I'm doing this is because the program I'm running has the
> > > same teams and people join different leagues. All the team and player
> > > information stays the same, but they might join another sports league.
> > > The problem I found is that each team might change their information
> > > JUST SLIGHTLY from league to league. Thus, if the information is
> > > copied over, the manager can easily go in and just make those several
> > > slight changes as opposed to having to go through the entire lengthy
> > > process of entering their team information with each session and each
> > > league.
>
> > > Hope you all can help and I hope I made some sense. Let me know if
> > > there is anything I failed to mention or if something doesn't entirely
> > > make sense.
>
> > > Thanks,
> > > Nino Skilj
>
> > Just dump the tables and load them into the new DB
>
> And do it quickly
Actually, I want to copy the same information into the same tables. So
it's like duplicating the data. Think of it like making a copy of a
file in the same folder and renaming it. Or how CVS makes a copy of a
version... That's more along the lines of what I'm going for. Any
ideas?
Nino |