vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Copying a table in the database... (https://vborg.vbsupport.ru/showthread.php?t=61732)

Kohhal 02-19-2004 02:43 PM

Copying a table in the database...
 
....I need to duplicate a table in the database, basically make a copy and rename it. The data in the fields doesn't matter, just the format of the table and fields.

Any help on how to achieve this?

G :)

Dark_Wizard 02-19-2004 02:55 PM

Quote:

Originally Posted by TheMasterG
....I need to duplicate a table in the database, basically make a copy and rename it. The data in the fields doesn't matter, just the format of the table and fields.

Any help on how to achieve this?

G :)

Your asking two things...one is to duplicate it and another to rename it...so I will give you some basic info on MySQL.

MySQL will allow you to rename the table which copies the table to a temp table, then creates a new table with the new name and copies the data from the temp table into the new one and finally removes the old table.

If this isn't what you need then please indicate which process you need to do.

Kohhal 02-19-2004 05:55 PM

Thanks for the reply.

I still need the original table I'm copying, just need a duplicate under a different name. Hope I've explained it clearly, not sure....?

To be exact : I need a table called "rules" which would be a copy of the "faq" table, same fields, values etc.

G :)

AN-net 02-19-2004 06:25 PM

hmmm....
you could get the sql query for the table you want to duplicate and in that sql query you could just change the table name and poof you got a dublicated table with different name;)

example(original table):
[sql]
CREATE TABLE blahblah.....
[/sql]
example sql query for duplicate of original:
[sql]
CREATE TABLE blahblah2....
[/sql]
so basically just change the table name of the original table's sql query and you have a duplicated table;)


All times are GMT. The time now is 11:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01077 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete