Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
plz anyone tell me how to import data frome excel or Access to SQL Express
Posted

 
Share this answer
 
Comments
RaviRanjanKr 4-Sep-11 15:03pm    
Nice Links, My 5+
Uday P.Singh 5-Sep-11 1:31am    
Thanks Ravi :)
One way for both of these is to use Linked Server[^].

Basically you:
- define a linked server against the data source (Access, Excel etc)
- run a query to insert into Sql Server table based on a select on the linked server.

Some information about linking to Excel: http://support.microsoft.com/kb/306397[^]
 
Share this answer
 
In case linked server is not supported in SQL express , there are data migration applications which copy tables and structures between different database types. Search for data migration in goggle and you will find them.
 
Share this answer
 
Have a look one of the great Library named FileHelpers library. there is an excellent article-[FileHelpers v2.0 - Delimited (CSV) or Fixed Data Import/Export Framework][^] in CP which will help you import just about any flat-file, CSV, and Excel with its all details.

Reference Link :- import csv file/excel into sql database[^] and Links Recommended by User-Marc_S[^]

You can also go for one of Other CP Reference is Import Data from Excel to SQL Server[^]
 
Share this answer
 
v2
You can use T-SQL, try this:

bulk insert [dbo].[Courses]
from 'C:\Courses.csv'
with (fieldterminator = ',', rowterminator = '\n')
go



For more info, check this post: Importing a CSV File into SQL Server
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900