Home All Groups Group Topic Archive Search About

BCP IN: create table on-the-fly

Author
13 Jan 2006 4:32 PM
Test Test
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.developersdex.com ***

Author
13 Jan 2006 4:51 PM
Andrew J. Kelly
Whats wrong with CREATE TABLE xxx?

--
Andrew J. Kelly  SQL MVP


Show quote
"Test Test" <farooqhs_2***@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.developersdex.com ***
Author
13 Jan 2006 6:45 PM
Test Test
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.developersdex.com ***
Author
13 Jan 2006 11:09 PM
Erland Sommarskog
Test Test (farooqhs_2***@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, 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
Author
14 Jan 2006 1:05 PM
ML
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/

AddThis Social Bookmark Button