Using of BULK INSERT
STEP 1: Create a text file the name STUDENTS_LIST.txt and add the bellow data
1,RAJIV,M.S
2,VINAY KUMAR,B.A
3,HANU,M.B.A
4,ARUN,M.Sc
STEP 2: Create a table using bellow statment
STEP 3: Now use the Bulk Insert Statement
STEP 4: Check the table using bellow query
Tags: BULK INSERT, Insert, Sql Server, SQL, Query
STEP 1: Create a text file the name STUDENTS_LIST.txt and add the bellow data
2,VINAY KUMAR,B.A
3,HANU,M.B.A
4,ARUN,M.Sc
CREATE TABLE #STUDENT(ID INT, [NAME] NVARCHAR(50), EDUCATION NVARCHAR(20))
BULK INSERT #STUDENT
FROM 'D:\STUDENTS_LIST.txt'
WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' )
SELECT * FROM #STUDENT
DROP TABLE #STUDENT
Tags: BULK INSERT, Insert, Sql Server, SQL, Query
No comments:
Post a Comment