Bulk Insert
Bulk Insert
SYNTAX
BULK INSERT Employee
FROM 'C:\Data\EmployeeData_c.dat'
[WITH
(
DATAFILETYPE = 'char',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\r\n'
)]
ARGUMENTS
FORMAT :- Specifies the type of file that we are trying to access.
Eg: CSV, TXT, DAT…
CSV : Comma Separated Values.
FIELDQUOTE :- Specifies a character that will be used as the quote character in the CSV file. If
not specified, the quote character (") will be used as the quote character.
FIRSTROW :- Specifies the number of the first row to load. The default is the first row in the
specified data file.
LASTROW :- Specifies the number of the last row to load. The default is 0, which indicates the
last row in the specified data file.
ARGUMENTS (CONT.)
FEILDTERMINATOR :- Specifies the field terminator to be used for char and widechar data files.
The default field terminator is the '\t' (tab character).
ROWTERMINATOR :- Specifies the row terminator to be used for char and widechar data files.
The default row terminator is the '\n' (newline character).