상세 컨텐츠

본문 제목

Using the openrowset fuction in ms-sql 2008

DataBase/MS-SQL

by xarfox 2009. 10. 8. 15:06

본문


EXEC sp_configure 'show advanced options',1;
go
reconfigure;
go
exec sp_configure 'Ad Hoc Distributed Queries',1
go
reconfigure;
go


USE STCW
GO
INSERT INTO dbo.ABS_PARTNO_NM_20090930
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\Book1.xls', 'SELECT * FROM [Sheet1$]')
GO

※ 엑셀 파일의 첫 행의 이름은 데이터베이트 테이블의 컬럼명과 일치해야 한다.


참조
http://cafe.naver.com/goodhint.cafe?iframe_url=/ArticleRead.nhn%3Farticleid=1323

관련글 더보기