Copy a database with copy the .mdf file and attaching it with a new name?


hello,

if have given database (a model) , want copy database in same database instance. ok copy the mdf and ldf file , attach files new database name in same instance.

or datebase name part of .mdf file?

regards
markus

 

 

 

i tried this  - , did not work. attach copied database after renaming , original database, still point first physical database, i.e. original .mdf-file ... later database wasn't recognized anymore ... etc.

there easiere way figured out:

- right click on database want copy

- select "tasks" , subsequently select "backup" , backup.

- right click on "databases"

- select "restore database"

- enter name of new database (your copy target) , select database copied source database

- click "ok" (sql server creates new database backup means copied original database)

if wanted database design , not content, ... delete <tablename> ...



SQL Server  >  SQL Server Express



Comments

Popular posts from this blog

Reindexing

Users List

List of charts