CREATE TABLE CSVTestNewTest
(
[Offer Ref] Nvarchar (255),
[Quote Ref] Nvarchar(100),
[Midwich Part] Nvarchar(200),
[Midwich Part Description] Nvarchar(200),
[Minimum] nvarchar(50),
[Qty] nvarchar(200),
[Free Part Description] nvarchar(max),
[Offer Description] nvarchar(max),
[Type] nvarchar(100),
[Available Qty] nvarchar(200)
)
GO
BULK
INSERT CSVTestNewTest
FROM 'D:\varun\Project Assets\Qb Assets\Qb Assets\Data Feed 30june11\data\free_parts.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
Description: first of all create table of all the column available in excel or csv file. then with the bulk insert statement give the location where your excel or csv file is stored and exceute the query with syntax describe above.
No comments:
Post a Comment