Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Need Details regarding Backup and restore

Author  Topic 

siva237
Starting Member

3 Posts

Posted - 2010-11-17 : 23:55:04
I am taking backup of a online database and restoring it to a new database programatically using a stored procedure.All the back up and restore operation is successfull but observed that there is a data loss in few tables. There is no data loss if I manually take backup and restore it.I wonder why this is happening.Could anybody please look into this and expalin me the reasons casuing this problem.Expedite reply is highly appreciated..

Below are the deatils regarding backup and restore

The source database is online and in full recovery mode

The template of backup command is

backup database [databasename] from disk ='filepath'
with
noformat,
noinit,
name = 'datbasefilename',
norewind,
nounload,
skip'



v.siva prasad

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-18 : 01:05:52
There will be no data loss with backup/restore. You are doing something wrong if data is missing. Show us your entire script as what you have posted is fine.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

siva237
Starting Member

3 Posts

Posted - 2010-11-18 : 01:54:30
Hi Tara,
Thanks for your reply.I think I have found the issue.I am restoring database with file 1.I believe there are multiple full backup files that being appended and the file 1 might have old data.

Thanks,
SIva Prasad

v.siva prasad
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-18 : 12:41:43
Use WITH INIT to avoid this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-11-18 : 12:41:57
Or you'll have to specify the file number in the restore command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -