tags:

views:

99

answers:

2

what select statement would I use to add the excel spreadsheet to an existing table, as i am getting an error trying to create a new table on the database? please can you assist me. Thanks

+1  A: 

Fiona --

You're probably using the wrong tools here. You probably want to use a tool called SQL Server Integration Services to get your data into SQL Server. You can do this by right-clicking on your database in SQL Server Enterprise Manager, selecting "Tasks". then "Import Data". You'll probably need to do some more research on what you're doing in order to accomplish what you want.

Dave Markle
If you dont have SSIS in your version of SQL Server, you can use DTS.
StingyJack
I have done the exact thing that you are telling me but i still getting an error, Maybe i am not have permission to do it, Thanks for your help
Fee
+1  A: 

you can also do it with OPENROWSET

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