Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Posts
    3

    Question Unanswered: Importing binary data tables?

    My apologies in advance for hitting the forum with such a basic question...

    I've got a large number of raw binary data tables generated by some external software that I'd like to import into a SQL database. I've set up the database tables to hold the information and assigned the table columns the appropriate data types, but I can't figure out how to import the data.

    From what I can see there isn't a data import 'wizard' that supports raw binary, and my limited experience with bcp has given me the impression that it only supports ASCII tables. I find it hard to believe that there isn't a DTS procedure to handle this... but I'm definitely stuck...


    Thanks,
    -fpsiv

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    You can import data by using bcp or bulk insert to text or image fields and then parse data if it needs.

  3. #3
    Join Date
    Oct 2003
    Posts
    3
    Thanks for the quick reply snail...

    I was working with BULK INSERT via the Query Analyzer... but ran into a brick wall in trying to set up the format file. I can't seem to get the 'column collation' parameter set correctly. I thought that 'collation' applied to character data... is there a correct collation for raw binary?

    Thanks,
    -fpsiv

  4. #4
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Check this : import image, I was trying to the same for binary file - it works too.

    http://www.dbforums.com/t926676.html

  5. #5
    Join Date
    Oct 2003
    Posts
    3

    Thumbs up

    Thanks snail... got it working! I really appreciate your help!

    Cheers
    -fpsiv

  6. #6
    Join Date
    Jun 2003
    Posts
    31
    hmmml ! I tried the same query but it didn't worked :

    CREATE TABLE Pictures
    (
    Pic_id smallint
    IDENTITY(1,1)
    PRIMARY KEY CLUSTERED,
    Images nvarchar(5000)
    )


    BULK INSERT Northwind.dbo.[pictures] FROM 'c:\bridge.jpg'
    WITH (
    FORMATFILE = 'c:\bcp.fmt'
    )

    ---------------------------------------
    Server: Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'from'.

    Did I missing something?

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •