[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

Copy table structure and data as a new table to the same database

I have a database with a table called Budget_Actual.  I need to copy the entire table structure and data to a new table named Budget_Actual_2009 in the same database, What would be the best approach to accomplish this task?
0
JessyRobinson1234
Asked:
JessyRobinson1234
2 Solutions
 
chapmandewCommented:
select *
into budget_annual_2009
from budget_annual
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Select * Into wont create the indexes and relations on the table, so in case you need those, you may have to create them manually after running the above query  or else  you can generate the script for the existing table after  renaming  the keys you can run them and populate the data
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now