Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



Restore a database to another database The backup set holds a backup of a database other than the existing


Home  > MSSQL  > Restore a database to another database The backup set holds a backup of a database other than the existing 
       
This is how u restore database when the database already consist a copy of another database or other tables. Now this can be used
for any error. easier metod is to rename the files. But I perfer to do the things the right way. 

Sorry Guys I am just about to leave. I am just putting up the chat log. 



Hi: Pls i am tri=ying to restore a database to another database
Murugan Andezuthu Dharmaratnam: ok
Murugan Andezuthu Dharmaratnam: how can i help u
Hi: I got this errorystem.Data.sqlClient.sqlError
Murugan Andezuthu Dharmaratnam: can u tell me the exact steps 
Hi: I copied the backup to be restored to thwe backuop folder of my sql server
Hi: created a dummy db
Murugan Andezuthu Dharmaratnam: ok
Hi: point to the diorectory
Hi: an d click ok
Hi: I got the error The backup set holds a backup of a database
Hi: other than the existing
Murugan Andezuthu Dharmaratnam: OK
Hi: I need ur help
Murugan Andezuthu Dharmaratnam: Now this is what u need to do 
Hi: ok
Murugan Andezuthu Dharmaratnam: This error occurs because 
Murugan Andezuthu Dharmaratnam: in the data director of sql 
Murugan Andezuthu Dharmaratnam: and MDB and LOG file exists
Murugan Andezuthu Dharmaratnam: U need to delete the database
Murugan Andezuthu Dharmaratnam: go to the directory remove the log and mdb files
Hi: ok
Murugan Andezuthu Dharmaratnam: create database again 
Murugan Andezuthu Dharmaratnam: and restore and select force restore over existing database 
Murugan Andezuthu Dharmaratnam: and u will be good to go 
Murugan Andezuthu Dharmaratnam: do u want step by step instructions
Hi: yes. new to database
Murugan Andezuthu Dharmaratnam: Ok
Murugan Andezuthu Dharmaratnam: right click on the database
Murugan Andezuthu Dharmaratnam: What ever temporary database u had created
Hi: ok
Murugan Andezuthu Dharmaratnam: Select Task -> Restore -> Database
Murugan Andezuthu Dharmaratnam: U get the restore database window
Hi: ok
Murugan Andezuthu Dharmaratnam: now on the left side u can see 
Murugan Andezuthu Dharmaratnam: general and 
Murugan Andezuthu Dharmaratnam: options
Murugan Andezuthu Dharmaratnam: click on options
Hi: ok
Murugan Andezuthu Dharmaratnam: U can see a grid 
Murugan Andezuthu Dharmaratnam: orginal file name, file type, restoreas
Hi: ok
Murugan Andezuthu Dharmaratnam: click on restore as 
Murugan Andezuthu Dharmaratnam: copy that directory path 
Murugan Andezuthu Dharmaratnam: open windowsexplorer to go to that directory 
Murugan Andezuthu Dharmaratnam: In Mine its 
Murugan Andezuthu Dharmaratnam: C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\
Murugan Andezuthu Dharmaratnam: Brother R U There 
Hi: yes Boss
Murugan Andezuthu Dharmaratnam: Ok
Murugan Andezuthu Dharmaratnam: now u locate the two files with the youdatabasename.mdb and yourdatabasename.ldf
Murugan Andezuthu Dharmaratnam: Do Nothing
Murugan Andezuthu Dharmaratnam: Wiat
Murugan Andezuthu Dharmaratnam: Wait
Hi: ok
Murugan Andezuthu Dharmaratnam: Now go back to Microsoft SQL Server Management Studio
Murugan Andezuthu Dharmaratnam: close the restore database window
Hi: k
Murugan Andezuthu Dharmaratnam: Right Click on the database and select delete 
Hi: ok
Murugan Andezuthu Dharmaratnam: Now What u need to do is 
Murugan Andezuthu Dharmaratnam: go back to windows explorer
Hi: ok
Murugan Andezuthu Dharmaratnam: delete the yourdatabase.ldf and yourdatabase.mdf file
Hi: ok
Murugan Andezuthu Dharmaratnam: OK 
Murugan Andezuthu Dharmaratnam: Now 
Murugan Andezuthu Dharmaratnam: Right click on the root tab Databases and select New Database
Murugan Andezuthu Dharmaratnam: Wait for me 
hi: ok
Murugan Andezuthu Dharmaratnam: Right Click and select Restore -> Database
Murugan Andezuthu Dharmaratnam: Task -> Restore -> Database
hi: ok
Murugan Andezuthu Dharmaratnam: Now select 
Murugan Andezuthu Dharmaratnam: from device
Murugan Andezuthu Dharmaratnam: The File Browser ... 
Murugan Andezuthu Dharmaratnam: Select the backup
Murugan Andezuthu Dharmaratnam: click ok
Murugan Andezuthu Dharmaratnam: Now in the grid u can see the database
Murugan Andezuthu Dharmaratnam: check it yes
Murugan Andezuthu Dharmaratnam: go to options on the left menu 
hi: ok
Murugan Andezuthu Dharmaratnam: Options 
Murugan Andezuthu Dharmaratnam: Retore Options
Murugan Andezuthu Dharmaratnam: Check Overwrtie existing database
Murugan Andezuthu Dharmaratnam: Click On Ok
Murugan Andezuthu Dharmaratnam: U should be good to go 
index

create udl file to test sql connection to the sql server

Error: 18452 SQL Server 2005 "Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection."

How to copy a table with data to one db to another in sql 2005

How to insert multiple records to a table using a single Insert query

How to insert values to multiple tables using a single insert query statement

How to replace a part of a string of a field using query in MSSQL

ms sql Add field to table using Alter Table

ms sql server 2005 express edition

MSSQL What is the use of COALESCE() function

System.Data.SqlClient.SqlError The backup set holds a backup of a database other than the existing

What are the different login modes in sql server

where is sql server 2005 files stored

Windows 7 SQL Server 2008 Express R2 Error Unable to connect from remote machine desktop

sql server error exception system.data.sqlclient.sqlerror the media set has 2 media families but only 1 are provided

Restore a database to another database The backup set holds a backup of a database other than the existing

Stored Procedure Introduction

How to execute a stored procedure on the sql server query analzer

Create Stored Procedure Example For beginner

stored procedure variable orderby

Stored Procedcure to Update Table

Stored Procedure Input Variables

not getting sql server properties on clicking udl file opening as text

Generic Stored Procedure To Return Get Data From Table With Paging

Single Stored Procedure Insert Update Delete

Stored Perocedure ROWCOUNT

Invalid use of a side effecting operator EXECUTE STRING within a function

SQL Query MAX Value column

MSSQL Select GroupBy

SQL Occurrence of character in a string

TSQL Functions

t sql string manipulation STRING BETWEEN TWO STRINGS

TSQL CHECK IF NULL

Generic Stored Procedure Insert Update Delete

Cannot call methods on nvarchar max



  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  PHP   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

Copyright 2009 @ Murugan Andezuthu Dharmaratnam