문제

I'm trying to import some data from an Excel sheet into an existing SQL Server 2005 table.

The table has the following columns:

Name, Surname, PhoneNumber ,Bill

and they are in the same order in the Excel sheet.

I've never attempted such a thing before, but after searching for a while I was told I could use:

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

Do I need to reference the column names from the Excel sheet to the SQL Server table columns?

I'm certainly not a SQL guru, but would consider myself a good beginner.

Can anyone help?

도움이 되었습니까?

해결책

See here in you Management Studio :
Choose you db? enter image description here

Choose your source :
enter image description here

and from here is all just following the GUI !!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top