« Previous Next »

Not Answered Thread: Import from (Unix) CSV to SQL

Last post 10-27-2009 4:39 PM by ksingla. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-23-2009, 12:36 PM

    • NickStan
    • Not Ranked
    • Joined on 10-23-2009, 3:55 PM
    • Posts 1

    Import from (Unix) CSV to SQL

    I am having issues importing from CSV to a SQL table using Logparser.

     The csv file was created on a unix box so the line breaks are just Char(10)

     Here is the command I am using:

    LogParser -o:SQL -i:CSV "SELECT merchant_id,merchant_name,aw_product_id,merchant_product_id,product_name,description,category_id,category_name,merchant_category,aw_deep_link,aw_image_url,search_price,delivery_cost,merchant_deep_link,merchant_image_url,aw_thumb_url,brand_id,brand_name,commission_amount,commission_group,condition,currency,delivery_time,display_price,ean,in_stock,is_hot_pick,isbn,is_for_sale,language,merchant_thumb_url,model_number,mpn,parent_product_id,pre_order,product_type,promotional_text,rrp_price,specifications,stock_quantity,store_price,upc,valid_from,valid_to,warranty,web_offer INTO dbo.product_import FROM C:\Shares\data\23_10_2009.csv"
    -server:UK-App -database:test -driver:"SQL Server" -username:i_writer -password:i_writer777* -createTable:OFF

    Error messge:

    Task aborted.
    SQL table column "merchant_product_id" data type is not compatible with
      SELECT clause item "merchant_product_id" (type INTEGER)

    What I cant understand is that merchant_product_id is setup as an Int in the database, yet the error message is saying that the data type is not compatible?

     Thanks

     Nick

  • 10-27-2009, 4:39 PM In reply to

    • ksingla
    • Top 25 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 863

    Re: Import from (Unix) CSV to SQL

    Hi,

    How about trying with createTable:ON and comparing the table you created with the one created by logparser?

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
Page 1 of 1 (2 items)
Microsoft Communities