.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Restoring a record from backup

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :Sql Server
I need to restore a record from backup but the record in the main DB has been deleted along with its primary key. Can I restore that same record (with its primary key kept in place) to the main DB from the backup DB ? I don't want to generate a new primary key, just add it to where it was before. Theoretically, filling in the hole. Is this possible and so how? Thanks.- Tackling one issue after another..

View Complete Post

More Related Resource Links

Restoring DATA only from a backup set

Hi, We have a backup and are trying to restore this. The original database is no longer available. When we try to restore this, we get this error: System.Data.SqlClient.SqlError: There is insufficient free space on disk volume 'C:\' to create the database. The database requires 84120371200 additional free bytes, while only 51382657024 bytes are available. (Microsoft.SqlServer.Express.Smo) Gave RESTORE   FILELISTONLY FROM DISK and checked the contents. The problem is with the Trans log. It is too huge and guess it was allowed to grow without any restrictions. Is there any way we can restore the backup without restoring the log? Please advice. Thanks in advance.

MSSQL 2008 R2 - database in restoring mode after backup - forever..

Hi folks,   i have this problem that occourred today with one instance of MSSQL 2008 R2 running on a WIN x64 R2 enterprise server.   i have run a backup maintainance job and now i have two databases in restoring mode for over 4hrs.   my questions are: why are these databases restoring when i was backing up? and why are they not being logged anywhere - i can not find anything on logs, activty monitor, or even Windows Resource Monitor.   i can not see any work been done by MSSQL to restore these databases, and yet they are set as 'RESTORING'.   any suggestion from the community here will be much appreciated as i am banging my head against the wall already.   thanks,   Nicolas    data warehouse | data migration | ETL/ELT | UK | http://www.brainpowered.net

Error Restoring sql 2000 backup on SQL 2008 Error: 928


I'm restoring several sql 2000 user databases on a sql 2008 r2 box, but sometimes I receive the following error

Error: 928, Severity: 20, State: 1

During upgrade, database raised exception 156, severity 25, state 1, address 0000000001C05A9F. Use the exception number to determine the cause.

So the error occured after the restore and while upgrading the database schema from version: 539 to 661.

However I notice that if I try to restore it again with the same statement, sometimes it goes sometimes it doesn't.

I'm not finding any 823,824 or 825 errors on SQL log.

The database compatibility level is 80.

While running Upgrade Adivsor on the database I saw 27 objects that use the older outer join sintax *=. However being that just a warning I don't think that's the cause, moreover because if I retry sometimes the restore completes succesfully.

Does anybody knows what is this?

Is this the I/O subsystem failing?

Why is this intermitent?

How do I fix it?


Thanks in advance.


Restoring a Content Database to an earlier MSSQL backup?

We'd like to roll back a content database to an earlier point in time. Is this doable by just shutting down the frontend, and then restoring the MSSQL WSS_Content database, or are there some quirks that we need to take into account?

SQL Server Compatibility problem while backup and restoring ????


Hi ...

SQL Server Compatibility problem.

1. I have taken backup from sql server 2008 R2 , it is not restoring in sql server 2005 ?

Wats the problem and how to solve this issue ??

2. I have taken sql server 2008 R2 database and log file (mdf and ldf). it is also not attaching in SQL server 2005.

Plz help me to solve this .....

Problem in restoring backup file


at System.DBNull.System.IConvertible.ToBoolean(IFormatProvider provider)
   at System.Convert.ToBoolean(Object value, IFormatProvider provider)
   at Microsoft.SqlServer.Management.SqlManagerUI.BakDevMediaContents.InitBackupSets(Restore sqlRestore)
   at Microsoft.SqlServer.Management.SqlManagerUI.BakDevMediaContents.InitProp()
   at Microsoft.SqlServer.Management.SqlManagerUI.BakDevMediaContents.InitializeOffline(CDataContainer dataContainer)
   at Microsoft.SqlServer.Management.SqlManagerUI.BackupDeviceContents..ctor(CDataContainer dataContainer, IServiceProvider sp)
   at Microsoft.SqlServer.Management.SqlManagerUI.SqlRestoreSelectBackupSource.buttonContents_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)

Restoring only a few tables from the backup


Hello All,

I've a backup available to me (MS SQL 2005)- which is quite large. Is it possible to restore only a few tables instead of the entire database? These table may or may not exist on a single file group.



Restoring a SQL 2k backup to a new SQL 2008 db


I got a customer backup (from 2k, the file itself is named 115TCSSQL) that i'm trying to restore to my SQL 08 instance (the db i'm trying to restore with replace to is named 115th) to troubleshoot some goofy records he has.

I run restore filelistonly from disk  and i get the logical name and physical name



So i try to restore:



database [115th]



Problem restoring backup in SQL 2008 enterprise


I created a backup from an express version and now that im restoring it to an enterprise edition i keep getting an error. Can anyone help me?

I keep getting this error, that the version is incompatible with this server running on version 10.00.1442 and the backed up version is running on 10.00.2531.


Restoring Moss 2007 backup


Dear all

We have a backup taken from Moss 2007.  But, we are looking to restore it in a environment which has WSS 3.0.  Is it possible to perform such restoration ?? Pl help



Backup from SQL srv 2008 stdr R2 now restoring on SQL srv 2008 Dev ... Error



I used to have a SQL Server 2008 Standrad R2 installed, had 4 databases only. Now it seems that a bit of our project doesn't work that good with R2 so we decided to uninstall R2 ver and install the previos version: SQL Server 2008 Developer.

I backed up my databases, scripts and SPs, uninstalled the R2 ver and installed the the "other" version ... Dev ... now I want to restore my databases and get the following error:

System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.1600. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&LinkId=20476


I can't find any information on how to restore backwards.

Please help?


Error in restoring sql 2005 sp3 Backup with replication


I am not able to restore a backup of SQL 2005 SP3 with replication activated in this database.
TITLE: Microsoft SQL Server Management Studio

Restore failed for Server 'servername'.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476


System.Data.SqlClient.SqlError: Cannot drop the table 'dbo.MSpeer_lsns' because it is being used for replication. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.4035.00&LinkId=20476



also the store procedure sp_removedbreplication 'database name' is

Errors restoring DB from backup created on another server


I'm trying to restore a DB from a backup created on another server. The restore finishes but then I get the following error and everything rolls back. Has anyone seen this error before? Is there a resolution? Here's the response received.

Executing the query ...

<Restore xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">





Restoring a differential backup on a different server



I have a simple backup schedule for one of our database : full backup on fridays and differential the rest of the week.  I now want to restore this backup on a different server.  I can successfully restore the full backup but I can't restore the differential, even if i checked the no-recovery option.  The message I have is "Cannot apply the backup on device...".

Here is the header of my backup set.

BackupName         BackupDescription BackupType ExpirationDate      Compressed Position DeviceType UserName     ServerName DatabaseName  DatabaseVersion DatabaseCreationDate   BackupSize       FirstLsn          LastLsn           CheckpointLsn        DifferentialBaseLsn     BackupStartDate      BackupFinishDate     SortOrder CodePage UnicodeLocaleId UnicodeComparisonStyle CompatibilityLevel SoftwareVendorId SoftwareVersionMajor SoftwareVersionMinor SoftwareVersionBuild MachineName Flags    BindingId               RecoveryForkId             Collation
--------------------------- ------------------ ---------- ------------------------ ---------- -------- ---------- ----------------- ----------- --------------- --------------- ------------------------ ---------------------- --------------------------- --------------------------- --------------------------- --------------------------- ------------------------- ------------------------

GridView inline Master/Detail record display

This code drop is part of a smash and grab series. If you're in a rush, you can just grab this code and insert it into your application, no understanding is required. When you have some time (ya, right) you may want to review the source code.

SQL Server Backup and Restore (video)

Restore your full backup, then run a few queries before you keep restoring transaction logs. Brent shows how to use the Standby option for restores.

In this five minute video, Brent demonstrates how to do it by creating a database, populating data, and then showing what disaster recovery is like by doing RESTORE WITH STANDBY.

Get Top 1 Record from Dataset

Many of them in need of getting the Top 1 or Top 10 records from a Dataset without going to SQL query. It is possible to do from Code Behind. I have given the code below,
The below code is to get single record from a Dataset. Also I have given for getting 8 records at Green Color.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend