[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 452
  • Last Modified:

bulk import query in sql 2008

When i run the query i get zero rows affected .what i am doing wrong?

The query i am trying is

Bulk insert SDCData
from 'C:\WORKDRIVE\SHOPTHEWEB_DROPBOX\My
Dropbox\ShopTheWeb\bulkupload\mobile_phones_and_accessories.txt'
 WITH
   (
       FIELDTERMINATOR = '\t',
       ROWTERMINATOR = '\n',
       CODEPAGE='TEXT',
         DATAFILETYPE='char',
       FIRSTROW = 2,
       KEEPNULLS
       )


Table structure:

CREATE TABLE [dbo].[SDCData](
       [OFFER_ID] [varchar](25) NULL,
       [OFFER_TITLE] [varchar](96) NULL,
       [PRICE] [varchar](50) NULL,
       [OFFER_DESCRIPTION] [varchar](1024) NULL,
       [MERCHANT_ID] [varchar](50) NULL,
       [MERCHANT_NAME] [varchar](18) NULL,
       [MERCHANT_SKU_NUMBER] [varchar](21) NULL,
       [SDC_PRODUCT_ID] [varchar](50) NULL,
       [MPN] [varchar](14) NULL,
       [CATEGORY_NAME] [varchar](24) NULL,
       [STOCK] [varchar](8) NULL,
       [CATEGORY_ID] [varchar](50) NULL,
       [STOCK_DESCRIPTION] [varchar](76) NULL,
       [IMAGE_URL] [varchar](97) NULL,
       [MAX_IMG_WIDTH] [varchar](50) NULL,
       [MAX_IMG_HEIGHT] [varchar](50) NULL,
       [SHIPPING_RATE] [varchar](50) NULL,
       [SHIPPING_WEIGHT] [varchar](50) NULL,
       [ZIP_CODE] [varchar](20) NULL,
       [MANUFACTURER] [varchar](14) NULL,
       [ATTRIBUTES] [varchar](136) NULL,
       [MIN_CATEGORY_BID] [varchar](50) NULL,
       [MERCHANT_CATEGORY_BID] [varchar](50) NULL,
       [OFFER_URL_MIN_CATEGORY_BID] [text] NULL,
       [OFFER_URL_MERCHANT_CATEGORY_BID] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
Mobile-Phones-and-Accessories.zip
0
uma_
Asked:
uma_
  • 3
1 Solution
 
lofCommented:
Please keep it in one post. There is no need to cross post it.
0
 
lofCommented:
For people interested in the problem I will post solution under original question
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SQL_Server_2008/Q_25026450.html?cid=1572#a26202761
0
 
uma_Author Commented:
Hi,

The solution u provided i tried still it is not working.

I first post the comment in that post only no reply for an hour so i look for some other experts to get the help.Is it wrong?
0
 
lofCommented:
Please check again the original post. I wasn't able to test it earlier as I was at work. Now I had time to investigate the file you provided and I know the full answer to your problem.

Please bear in mind that most of as here are volunteers and not always you will get answer right away but still opening more and more posts will not help neither you nor people who later will have similar problem.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now