Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql File issues

Status
Not open for further replies.

rninja

Technical User
Apr 11, 2001
381
US
I have a problem here. I received a file from a client and it seems to be their database, but the file is full of garbage. Can anyone identify this and/or tell me what I can do with it? I will not post the whole thing here since it is over 4MB of text data and the data is sensitive but here is the header for identification:

FFFfg`
@
P
0



à ð ° À Ð P ` p € ? àÐÀ°p€? °ÀÐàð 0@@0 ðàÐÀ°P`p€? °ÀÐàð 0@Pp€? 0@P`ð ÀÐàp€? ° 0@P`À°ðÐàp€ ?0@`P ÀÐðàP`°p€? àð@ 0p`Ð °À€?0@P ðàÐÀ°`p€?  À
?°
€
p?
`€
Pp
@`
0P
@
0

ð
à
Ðð Àà °Ð À ?° € p? `€ Pp @` 0P @ 0  ð à ÐðÀà°ÐÀ°P @?0€p`?
@ €
0 p
`
P
@
0
ð

à


Ð
ð
À
°
à
Ð

ÐÀ ° ð?à€ðpàÐ`PÀ@°0  ?ЀÀp°` P?@€p0`P@ 0 ððàÐÀ°à€ ?p?€p``PP@@0 0ð àÐðÀ° à?ЀÀp°` 
Z ø:¨^98W!À`5=X
p;F0?(convert(smallint,0))0!(8000)i0½(case when ([rowcnt] > 2147483647) then 2147483647 else (convert(int,[rowcnt])) end)ÿ0³(convert(tinyint,(([bitpos] & 7) + case when ([typestat] & 1 = 0) then 8 else 0 end + case when (([typestat] & 2 <> 0 or (type_name([xtype]) = 'image' or type_name([xtype]) = 'text') and [colstat] & 0x1000 <> 0)) then 16 else 0 end + case when (((type_name([xtype]) = 'image' or type_name([xtype]) = 'text') and [colstat] & 0x2000 <> 0 or (type_name([xtype]) = 'timestamp' or (type_name([xtype]) = 'char' or type_name([xtype]) = 'binary')) and [typestat] & 1 = 0)) then 32 else 0 end + case when ([colstat] & 4 <> 0) then 64 else 0 end + case when ([colstat] & 1 <> 0) then 128 else 0 end)))0?(convert(tinyint,xtypetotds([xtype],(1 - ([typestat] & 1)))))0?(convert(smallint,columnproperty([id],[name],'oldusertype')))0W(convert(varchar(255),[autoval]))0û(convert(smallint,case when ((type_name([xtype]) = 'ntext' or (type_name([xtype]) = 'image' or type_name([xtype]) = 'text'))) then null when (type_name([xtype]) = 'uniqueidentifier') then [xprec] else (odbcprec([xtype],[length],[xprec])) end))!0O(odbcscale([xtype],[xscale]))0](convert(int,sign(([colstat] & 4))))0](convert(int,sign(([colstat] & 4))))0_(convert(int,(1 - ([typestat] & 1))))0•(convert(sysname,collationpropertyfromid([collationid],'name')))­0 ©(convert(binary(5),collationpropertyfromid([collationid],'tdscollation')))0
?(convert(smallint,typeproperty([name],'oldusertype')))LW!0A(convert(bit,case when ((type_name([xtype]) = 'nvarchar' or (type_name([xtype]) = 'varchar' or type_name([xtype]) = 'varbinary'))) then 1 else 0 end))0[(convert(bit,(1 - ([status] & 1))))0e(convert(tinyint,xtypetotds([xtype],0)))u0M(convert(varchar(255),null))0(convert(smallint,case when ((type_name([xtype]) = 'ntext' or (type_name([xtype]) = 'image' or type_name([xtype]) = 'text'))) then null else (typeproperty([name],'precision')) end))0s(convert(tinyint,typeproperty([name],'scale')))0•(convert(sysname,collationpropertyfromid([collationid],'name')))0m(convert(smallint,(2 + 4 * ([status] & 1))))0?(convert(smallint,0))0O(convert(bit,([status] & 1)))0 O(convert(bit,([status] & 2)))!0
Ù(convert(nvarchar(4000),case when ([status] & 2 = 2) then (uncompress([ctext])) else [ctext] end))u0 ?(convert(smallint,0))0 ?(convert(smallint,0))0 O(convert(bit,([status] & 2)))0
O(convert(bit,([status] & 4)))0
O(convert(bit,([status] & 8)))0?(convert(smallint,0))0 ?(convert(smallint,0))0
¹(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],1,2))),0)))VW!0
¹(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],3,2))),0)))0 ¹(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],5,2))),0)))WW!0
¹(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],7,2))),0)))0¹(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],9,2))),0)))YW!0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],11,2))),0)))0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],13,2))),0)))0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],15,2))),0)))0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],17,2))),0)))0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],19,2))),0)))0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],21,2))),0)))!0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],23,2))),0)))0»(convert(smallint,isnull(convert(binary(2),reverse(substring([forkeys],25,2))),0)))h88
?_W!(0
h_W!@_W!дø<€ÄL?Ô\ ä¤dÄt4ôÈx8È0¼<ì„(ä ` ´

¼
\
ü ¬ °XÈ8„Ä `-.J9–<•0. ¥¥ 
úÿ
úÿ 
Crefmod0.
44 
=uid¥0.
44 
Cstatus0.
çÿÿÿÿÐ4 ?name0.
¥¥Uþÿþÿ 
=sidaV!0.
¥¥ýÿýÿ 
Aroles0.
== 
Kcreatedate0.
== 
Kupdatedate0.
44 
Caltuid0.
¥¥ üÿ üÿ 
Gpassword0.
88
 
;id0.
44 
EsmallidjV!0.
00
 
?type0.
çÿÿÿÿÐ4 ?name0.
bbPþÿþÿ 
Avalue0. 88
 <
;id0. 88
 <
Adepidg0. 44 
<
Cnumber0. 44 <
Idepnumbert0. 44 <
Cstatus0. 00 <
Edeptype0. 44
Edepdbid0. 44
Idepsiteid0. hh  
Cselall0. hh

Thanks! I appreciate any help available in solving this matter.

Rninja

smlogo.gif

 
What is the extension of the file? If it is their database then have you tried doing a restore into SQL Server?
 
If it is a "backup" of the database, it usually will have an extension of .BAK. If they sent you a copy of the database file itself, and it is a SQL Server DB, then the extension for the DATA file of the DB will be .MDF. They may have also sent you a data file for the associated LOG in which the extension for that file would be LDF.

SO ... if it was a .BAK ... RESTORE the database using Enterprise Manager or use the T-SQL command in Query Analyzer to restore the backup.

If you recieved BOTH an MDF and LDF file, you will need to ATTACH the files using Enterprise Manager or the T-SQL command of sp_attach_db in Query Analyzer.

If you recieved ONLY the MDF and NOT an LDF file, you will need to ATTACH the MDF file using Enterprise Manager or the T-SQL command of sp_attach_single_file_db in Query Analyzer.

Both of those T-SQL commands and syntax can be found in BOL (Books OnLine)

Hope this helps!


Thanks

J. Kusch
 
FYI ... you may want to post questions of this type content in the SQL Server Setup and Admin forum for fast results. This forum is more for DTS issues.

Have a good one!

Thanks

J. Kusch
 
Thanks Guys. I will try that method. It was handed over in an unnamed format so I suspect the developer who wrote it was trying to sabotage the file, or perhaps it was simply not transfered correctly.

I will try to restore it into the DB!

Thanks again!

Rninja

smlogo.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top