all groups > sql server programming > may 2006 >
You're in the

sql server programming

group:

to read backup file


to read backup file Zenek
5/20/2006 4:38:41 PM
sql server programming:
Hello,


I have:
- server MS SQL MSDE (2000)
- database 'COLLBASE'
- table 'MAIN'
- row: column 'NAME' value 'version' and column 'VALUE' value '003'

I make backup files by SQL query.
I have more backups for different versions of this database (different
value in field 'VALUE' in table 'MAIN').

I would like to read this value from backup file without server assist,
to get backup as ordinary file.
How to do it?
How to move in this file?
What is physical structure of backup file?

I can't to read this file from begin by compare strings, because these
files are very large, few 100MB.

regards
RE: to read backup file hongju
5/20/2006 4:57:01 PM

You must restore to another place and then you can search a query.
You can't direct query from backup database.

"Zenek"님이 작성한 내용:

[quoted text, click to view]
Re: to read backup file Tibor Karaszi
5/20/2006 6:08:11 PM
How did you produce the backup files? Using the BACKUP DATABASE command?

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/


[quoted text, click to view]
Re: to read backup file Uri Dimant
5/21/2006 12:00:00 AM
Hi,Zenek
Without RESTORE the database with the different name you will be able to
check it out?


[quoted text, click to view]

Re: to read backup file Uri Dimant
5/21/2006 12:00:00 AM
Sorry, shoul be
Without RESTORE the database with the different name you will NOT be able
to
check it out?

[quoted text, click to view]

Re: to read backup file Zenek
5/21/2006 12:29:19 AM
Tibor Karaszi napisa³(a):
[quoted text, click to view]
yes

Regards,
Re: to read backup file Zenek
5/21/2006 7:09:45 PM
Uri Dimant napisa³(a):
[quoted text, click to view]

I have my small program for several database's operations and I
want fast to view, fast to know versions of backups (to read value of
one field), I want not to use server or some libraries, I want to use
f.e. in C fopen function and by fseek to get to needed information.
These backups come from different peoples, has different names and I
must (want very much) to know databases versions, without RESTORE,
Re: to read backup file Hugo Kornelis
5/21/2006 9:52:42 PM
[quoted text, click to view]

(snip)
[quoted text, click to view]

Hi Zenek,

Let me check if I understand you correctly: you want to code your own
program that looks in SQL Server database backup file, then reads the
first couple of hunderd (or more) bytes to get some information about
the database that it's a backup of?

To write such a program, you'd have to know how a SQL Server backup file
is structured. As far as I know, Microsoft has not disclosed this
information. That leaves you with pretty few options.

Debugging or otherwise revere engineering the source code is explicitly
prohibited in the license. I'm not sure if attempting to analyze the
backup file's structure by examining it and/or by trial and error is
also included in this provision - you'd have to consult a lawyer to find
out.

As far as I can tell, this leaves you with only one option - contact
Microsoft and ask them under what conditions they'd be willing to share
either the backup file format or the source code of the backup or
restore routines with you. I'm afraid your odds are pretty slim, but it
never hurts to ask...

--
Re: to read backup file Erland Sommarskog
5/21/2006 10:27:35 PM
Zenek (zingiel@op.pl) writes:
[quoted text, click to view]

First of all, this topic is discussed both in this newsgroup and in
comp.databases.ms-sqlserver. Please do not post the same question to
multiple newsgroups indepentently.

You have not made a very good job in explaining what you are looking
for. First I got the impression was that the data you were looking for
was data in aome table in the database.

But the above indicates that you want to read metadata about the backup
itself. In such cases, there is no need to restore the entire database.
Instead you can use RESTORE HEADERONLY to get this information. Yes, I
know you've said you want to do this without server or library, but that
is such a hopelessly dead end, that you have no choice but to discard it.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
AddThis Social Bookmark Button