ict-torquilclark
asked on
IMport from Excel into SQL
I am trying to import a spreadsheet into a SQL Table.
I have been trying to do this for 3 days no with no luck. Its beginning to get really frustrating.
By the looks of it the best way is to use linked Servers. I will attach how I have setup the linked server as a picture).
I then use the attached code to do the import and recieve the following error:
" Msg 208, Level 16, State 1, Line 3
Invalid object name 'EXCELLINK'. "
I have run " select * from sys.servers " and it returns that there is a Linked Server called EXCELLINK.
Can anybody suggest anything?
I have been trying to do this for 3 days no with no luck. Its beginning to get really frustrating.
By the looks of it the best way is to use linked Servers. I will attach how I have setup the linked server as a picture).
I then use the attached code to do the import and recieve the following error:
" Msg 208, Level 16, State 1, Line 3
Invalid object name 'EXCELLINK'. "
I have run " select * from sys.servers " and it returns that there is a Linked Server called EXCELLINK.
Can anybody suggest anything?
SELECT * INTO sanctionslist FROM EXCELLINK[sanctionslist$]
untitled.JPG
ASKER
I have run the attached code and have received the following error
"
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'SELECT * FROM [sanctionlist$]'.
"
The worksheet is definetly called sanctionlist
"
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'SELECT * FROM [sanctionlist$]'.
"
The worksheet is definetly called sanctionlist
SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel
8.0;DataSource=C:\SANCTIONSLIST.xls','SELECT * FROM [sanctionlist$]'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
8.0;DataSource=C:\purchase
This is for excel 2003 and a 32 bit SQL Server.