Solved

How to create a database from existing database in another name

Posted on 2011-02-20
6
285 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 167 total points
Comment Utility
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
Comment Utility
and for the script: What is the error?
0
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 166 total points
Comment Utility

Use Management Studio

Right click on the database
Select All Tasks
Select Copy Database...
Follow the wizard
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 18

Expert Comment

by:sventhan
Comment Utility
0
 

Accepted Solution

by:
ManSys UK earned 167 total points
Comment Utility
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
Comment Utility
Thanks for answers
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now