BULK INSERT IN SQL SERVER 2005 using KEYWORD BULK

CREATE TABLE EMPLOYEE
(
id INT IDENTITY(1,1) PRIMARY KEY NOT NULL,
EMPNAME VARCHAR(100),
SALARY DECIMAL
)

BULK
INSERT EMPLOYEE
FROM ‘c:\two.txt’
WITH
(
FIELDTERMINATOR = ‘,’ ,
ROWTERMINATOR = ‘\n’
)
GO

–Check data is inserted.
SELECT id , EMPNAME , SALARY FROM EMPLOYEE

Pawan Kumar
Pawankkmr@hotmail.com

Advertisements