Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

import data from excel file to sql server database Expand / Collapse
Author
Message
Posted Thursday, December 09, 2010 10:54 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, April 20, 2011 2:30 AM
Points: 19, Visits: 43

plz..........help any one .....how to import data from excel file to sql server database
Post #1032839
Posted Friday, December 10, 2010 12:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, July 14, 2011 3:53 AM
Points: 3, Visits: 44
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
IMPORT FROM EXCEL TO TABLE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Select * into XLSheet1 from OPENROWSET ('Microsoft.jet.OLEDB.4.0','Excel 8.0;
database=C:\Latest.xls;',
'Select * from [Report$]')

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT FROM TABLE TO EXCEL
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

INSERT INTO OPENROWSET ('Microsoft.jet.OLEDB.4.0','Excel 8.0;
database=C:\Latest.xls;',
'Select * from [Report$]')
select top 10 * from DataReport
Post #1032853
Posted Friday, December 10, 2010 12:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 4:23 AM
Points: 1,026, Visits: 635
Right click on the Database. Select Tasks-> Import data

The wizard will take U step by step.

Select excel as Datasource.

Post #1032856
Posted Friday, December 10, 2010 12:34 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Friday, January 20, 2012 3:42 PM
Points: 42, Visits: 21
Yup, easy solution is just Select destination database; right click go to Tasks -> Import Data.

A wizard will show up to import and that give option to import from Excel.
Select Microsoft Excel in DataSource.
Select Excel file you need to import.

Just follow the wizard steps. If you have long text in any column of Excel file; better to map the Source Column from Excel and Destination in DB table. Change the type properly that can parse Excel column's value else it will throw error.

Enjoy!

Regards,
Himanshu
Post #1032861
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse