Hello:
I have to create a bunch of tables with the same 10 fields at the top. I would like to create one table with the original 10 fields and then copy it to the other 60 table. Is there an easy way, or do I have to create each one manually by entering the 10 fields?
Loading

Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 15, 2010, 2:48 AM EDT
Generate SqlScript for creating table structure with your 10 fields. use the same sql code just change table name execute it as many times as you wants.
mark as answer if get some hint.
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 15, 2010, 1:29 AM EDT
What kind of tables these are??
GustavoRank #1,990 · 732 reputationPosted Mar 15, 2010, 1:30 AM EDT
They are MS SQL tables.
GustavoRank #1,990 · 732 reputationPosted Mar 15, 2010, 2:53 AM EDT
Thanks... I was hoping to do it with a tool (GUI). Im not that good at SQLScripts, but it will save a lot of time. Thanks.
paul daniel189 reputationPosted Mar 15, 2010, 2:57 AM EDT
http://www.java2s.com/Code/Oracle/Table/Createacopytableandinsertvaluetoit.htm
GustavoRank #1,990 · 732 reputationPosted Mar 15, 2010, 3:13 AM EDT
CREATE TABLE Bank
(
[SEQNO] int NOT NULL AUTO_INCREMENT,
[Status_ID] varchar(50),
[Class_ID] varchar(50),
[Group_ID] varchar(50),
[Type_ID] varchar(50),
[CreateBy] varchar(50),
[CreateDate] varchar(50),
[CreateTime] varchar(50),
[Note] varchar(MAX),
PRIMARY KEY (SEQNO)
)
GustavoRank #1,990 · 732 reputationPosted Mar 15, 2010, 3:30 AM EDT
CREATE TABLE [Bin]
(
[SEQNO] INT NOT NULL IDENTITY (1 ,1 ) PRIMARY KEY,
[Status_ID] varchar(50),
[Class_ID] varchar(50),
[Group_ID] varchar(50),
[Type_ID] varchar(50),
[CreateBy] varchar(50),
[CreateDate] varchar(50),
[CreateTime] varchar(50),
[Note] varchar(MAX)
);