Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to create a database from existing database in another name

Posted on 2011-02-20
6
Medium Priority
?
300 Views
Last Modified: 2012-06-21
Hi,
I have one database called KalasamDB in my SQL Server . I want to create another database as the same as KalasamDB with another name. Therefore I have done like this, Scrict database as -Create TO - New Query Editor Window. Then I have find and replaced all the names of KalasamDB into KnowledgebaseDB. But its giving me an error.
I have also changed the path but I couldn't figure out the problem here.

Can anyone help me plzz?

---------------------------------------------------------------------------------------------------------------------
0
Comment
Question by:sivakugan
6 Comments
 
LVL 3

Assisted Solution

by:sunezapa
sunezapa earned 668 total points
ID: 34939880
I would make a backup to file, rename the existing database and restore the backupfile, maybe have a look on the option to change the SQL-filenames.
quick and easy - if you have access to the server, of course...
0
 
LVL 3

Expert Comment

by:sunezapa
ID: 34939882
and for the script: What is the error?
0
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya earned 664 total points
ID: 34940035

Use Management Studio

Right click on the database
Select All Tasks
Select Copy Database...
Follow the wizard
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
LVL 18

Expert Comment

by:sventhan
ID: 34942875
0
 

Accepted Solution

by:
ManSys UK earned 668 total points
ID: 34949337
I'm assuming you don't want the data copied, which is why you've scripted it so the chances are it's trying to save the MDF and LDF files over the existing KALASMDB files (because they're not called KALASAMDB.mdf?).  I would find ".mdf" and make sure that file does not exist, also same for ".ldf".

If you're trying to do an exact copy, i.e. data too, then backup / restore is the best option as others have said here.
0
 

Author Comment

by:sivakugan
ID: 35134207
Thanks for answers
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question