SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


import data from excel file to sql server database


import data from excel file to sql server database

Author
Message
gupta.sreekanth
gupta.sreekanth
SSC Rookie
SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)SSC Rookie (25 reputation)

Group: General Forum Members
Points: 25 Visits: 43
plz..........help any one .....how to import data from excel file to sql server database
Sandeep Moturi
Sandeep Moturi
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 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
Pulivarthi Sasidhar
Pulivarthi Sasidhar
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1702 Visits: 1021
Right click on the Database. Select Tasks-> Import data

The wizard will take U step by step.

Select excel as Datasource.
himanshumarwaha
himanshumarwaha
SSC Rookie
SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)SSC Rookie (44 reputation)

Group: General Forum Members
Points: 44 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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search