Method 1:
BULK
INSERT dbo.BrandAAIA
FROM 'D:\data work\ParentSupplierBrand\ParentSupplierBrand.txt'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '\n'
)
GO
=========================================================
Method 2:
create table #FileContents
(
LineContents nvarchar(max)
);
insert into #FileContents
select f.BulkColumn
from openrowset
(
bulk 'D:\data work\ParentSupplierBrand\ParentSupplierBrand.txt',
SINGLE_CLOB
) f;
select * from #FileContents;
DROP TABLE #FileContents
BULK
INSERT dbo.BrandAAIA
FROM 'D:\data work\ParentSupplierBrand\ParentSupplierBrand.txt'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '\n'
)
GO
=========================================================
Method 2:
create table #FileContents
(
LineContents nvarchar(max)
);
insert into #FileContents
select f.BulkColumn
from openrowset
(
bulk 'D:\data work\ParentSupplierBrand\ParentSupplierBrand.txt',
SINGLE_CLOB
) f;
select * from #FileContents;
DROP TABLE #FileContents
No comments:
Post a Comment