SQL Question
-
I have an empty table I set up as a Master table template. How can I copy this table and give it a new name using SQL? I have to create a new table each day so I just want to copy this template table I have.
select * into new_table from old_table where 1 = 0
This will copy the basic structure, but it will not create indexes, PK, constraints, etc. Kant wrote: Actually she replied back to me "You shouldn't fix the bug. You should kill it"
-
select * into new_table from old_table where 1 = 0
This will copy the basic structure, but it will not create indexes, PK, constraints, etc. Kant wrote: Actually she replied back to me "You shouldn't fix the bug. You should kill it"
-
Something like a "COPY TABLE STRUCTURE"? No, probably because it's not a good practice to spread your data through several small physical tables. Your physical database design should be decoupled from the logical design. Kant wrote: Actually she replied back to me "You shouldn't fix the bug. You should kill it"
-
I have an empty table I set up as a Master table template. How can I copy this table and give it a new name using SQL? I have to create a new table each day so I just want to copy this template table I have.
Oh boy... Your DB admin will love that :) Just use one table and add a date of entry column. Its soooooo much simpler.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall." George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.