Home All Groups Group Topic Archive Search About
Author
20 May 2006 2:38 PM
Zenek
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
Zenek

Author
20 May 2006 4:08 PM
Tibor Karaszi
How did you produce the backup files? Using the BACKUP DATABASE command?

Show quote
"Zenek" <zing***@op.pl> wrote in message news:e4n9l6$min$1@news.onet.pl...
> 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
> Zenek
Author
20 May 2006 10:29 PM
Zenek
Tibor Karaszi napisa³(a):
> How did you produce the backup files? Using the BACKUP DATABASE command?
>
yes

Regards,
Zenek
Author
20 May 2006 11:57 PM
hongju
You must restore to another place and then you can search a query.
You can't direct query from backup database.

"Zenek"님이 작성한 내용:

Show quote
> 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
> Zenek
>
Author
21 May 2006 5:15 AM
Uri Dimant
Hi,Zenek
Without RESTORE the database with the different name you will be able to
check it out?


Show quote
"Zenek" <zing***@op.pl> wrote in message news:e4n9l6$min$1@news.onet.pl...
> 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
> Zenek
Author
21 May 2006 5:53 AM
Uri Dimant
Sorry, shoul be
Without RESTORE the database with the different name you will NOT be able
to
check it out?

Show quote
"Uri Dimant" <u***@iscar.co.il> wrote in message
news:%23ud08VJfGHA.4776@TK2MSFTNGP05.phx.gbl...
> Hi,Zenek
> Without RESTORE the database with the different name you will be able to
> check it out?
>
>
> "Zenek" <zing***@op.pl> wrote in message news:e4n9l6$min$1@news.onet.pl...
>> 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
>> Zenek
>
>
Author
21 May 2006 5:09 PM
Zenek
Uri Dimant napisa³(a):
Show quote
> Sorry, shoul be
>  Without RESTORE the database with the different name you will NOT be able
> to
>  check it out?
>
> "Uri Dimant" <u***@iscar.co.il> wrote in message
> news:%23ud08VJfGHA.4776@TK2MSFTNGP05.phx.gbl...
>> Hi,Zenek
>> Without RESTORE the database with the different name you will be able to
>> check it out?
>>
>>
>> "Zenek" <zing***@op.pl> wrote in message news:e4n9l6$min$1@news.onet.pl...
>>> 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
>>> Zenek
>>
>
>

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,
without SERVER! :)
Author
21 May 2006 7:52 PM
Hugo Kornelis
On Sun, 21 May 2006 19:09:45 +0200, Zenek wrote:

(snip)
>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.

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...

--
Hugo Kornelis, SQL Server MVP
Author
21 May 2006 10:27 PM
Erland Sommarskog
Zenek (zing***@op.pl) writes:
> 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,
> without SERVER! :)

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, esq***@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
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button