2012年3月19日星期一

BCP IN: create table on-the-fly

Hello!
I have a BCP file (.BCP) and I want to do a BCP IN but I don't have a
table associated with it. (Lets say table got dropped). I am curious if
there is a way to create a table on-the-fly while doing BCP IN? Any neat
solution?
Thanks!
*** Sent via Developersdex http://www.examnotes.net ***Whats wrong with CREATE TABLE xxx?
Andrew J. Kelly SQL MVP
"Test Test" <farooqhs_2000@.yahoo.com> wrote in message
news:eTq4h7FGGHA.3080@.TK2MSFTNGP10.phx.gbl...
> Hello!
> I have a BCP file (.BCP) and I want to do a BCP IN but I don't have a
> table associated with it. (Lets say table got dropped). I am curious if
> there is a way to create a table on-the-fly while doing BCP IN? Any neat
> solution?
> Thanks!
>
> *** Sent via Developersdex http://www.examnotes.net ***|||Lets say ..I dont know the table structure. All I have found is a .BCP
file which is a binary file and can not be opened in text editor.
*** Sent via Developersdex http://www.examnotes.net ***|||Test Test (farooqhs_2000@.yahoo.com) writes:
> Lets say ..I dont know the table structure. All I have found is a .BCP
> file which is a binary file and can not be opened in text editor.
You now have a challenge. You see, there is not one possible table for
this file - but many. Some of them, makes more sense than others.
The file itself contains records only - there is no metadata. So all
you can to is to analyse combinations of bytes. Hm, here is a long
sequence of bytes with the ASCII codes of letter. Probably a character
string. And here is a sequence where every second byte is 0. Might
be Unicode.
In short, this will keep you busy a couple of days!
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||In addition to what Erland suggested, I'd start looking for the format file
-
if there ever was one, or some documentation to what this BCP file was used
for.
ML
http://milambda.blogspot.com/

没有评论:

发表评论