2013년 6월 11일 화요일

mssql - excel import

0. 방법
 - 아래 명령을 line by line으로 실행한다.

SP_CONFIGURE 'show advanced options', 1

RECONFIGURE

SP_CONFIGURE 'Ad Hoc Distributed Queries', 1

RECONFIGURE

INSERT INTO  table  (col1, col2)
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\excelfile.xls', 'SELECT * FROM [Sheet1$]')

1. excel file
 - 파일의 형태는 다음과 같다.



댓글 없음:

댓글 쓰기