• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

i would like to duplicate structure of one SQL database to new one, how i am doing that?

i am working with "Microsoft SQL Managment Studio 2008"
what are the steps?

Thanks
0
gvilbis
Asked:
gvilbis
3 Solutions
 
Aaron TomoskyTechnology ConsultantCommented:
Right click the server name, restore db, choose the other db as the source.
0
 
Rajkumar GsSoftware EngineerCommented:
Suggestions:-
Backup source database and restore over new. If you have any objects in new database, create script for that one and execute later.
Delete any data that is not required for new database. Better truncate table, which will reset IDENTITY columns as well.
TRUNCATE TABLE YourTable

Open in new window

If you have foreign key constraints, DELETE should start from child tables.

OR

Generate Scripts for all objects and execute one-by-one

Raj
0
 
Alpesh PatelAssistant ConsultantCommented:
to truncate all tables
execute 2-3 time until script execute without error.

EXEC sp_MSForEachTable 'TRUNCATE TABLE ?'
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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