- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2017 04:56 PM
- How do we copy a table? (identical everything (except name/sys_id, of course) in the same db/instance)
- How do we clone a new empty table with the same schema/definitions/etc. as an existing table but no records?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2017 06:55 PM
Jorge,
I'm going to answer in reverse order...
If you wish to create a copy of the table structure, but without any records, the cleanest way of performing this is to extend the table. You'll have to mark the parent table as 'extensible', but the result will be an identical table as the parent, without any records. You would then also have the option to add custom fields to the child table which would not appear in the parent; while also being able to add new fields to the parent, which would automatically show up in the child.
Once you extend the table, you can export the rows on the parent table and then re-import them into the child table to make a copy.
There's a lengthy discussion on this same topic found here: Is there any way to copy an entire table with a new name but same fields?
-Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2017 02:37 PM
Jorge,
We are glad you were able to take advantage of the ServiceNow Community to learn more and to get your questions answered. The Customer Experience Team is working hard to ensure that the Community experience is most optimal for our customers.
If you feel that your question was answered, we would greatly appreciate if you could mark the appropriate thread as "Correct Answer". This allows other customers to learn from your thread and improves the ServiceNow Community experience.
If you are viewing this from the Community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thanks!