Import data to the SQL server data table in batches from the text ================================ ============================ Author: locker (http://locker.itpub.net)
Posted on: 2004.11.26
Category: SQL Server
Source: http://locker.itpub.net/post/1523/7056
---------------------------------------------------------------
Reference style:
Use master
Create Database Accounting
Go
Create Table accounting. DBO. Customer (
Customerid nchar (5) not null,
CompanyName nvarchar (40) not null,
Contactname nvarchar (30) null,
Contacttitle nvarchar (30) null,
Address nvarchar (60) null,
City nvarchar (15) null,
Region nvarchar (15) null,
Postalcode nvarchar (10) null,
Country nvarchar (15) null,
Phone nvarchar (24) null,
Fax nvarchar (24) null)
Go
bulk insert accounting. DBO. customer
from 'C: selfpacedsqlch_9newcustomerdata1.txt '
with
(
datafiletype = 'Char',
fieldterminator = ',',
rowterminator = 'n')