Discussion:
BCP IN: create table on-the-fly
(too old to reply)
Test Test
2006-01-13 16:32:00 UTC
Permalink
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 ***
Andrew J. Kelly
2006-01-13 16:51:44 UTC
Permalink
Whats wrong with CREATE TABLE xxx?
--
Andrew J. Kelly SQL MVP
Post by 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 ***
Test Test
2006-01-13 18:45:51 UTC
Permalink
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 ***
Erland Sommarskog
2006-01-13 23:09:25 UTC
Permalink
Post by 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.
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, ***@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
ML
2006-01-14 13:05:02 UTC
Permalink
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/

Continue reading on narkive:
Search results for 'BCP IN: create table on-the-fly' (Questions and Answers)
3
replies
exporting data from ms sql server 2005 ?
started 2007-11-06 08:37:42 UTC
programming & design
Loading...