Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Hilary
Starting Member
1 Post |
Posted - 2011-04-28 : 03:26:04
|
| How to import data from Ms-Excel to SQL Server databaseAhanthem Hilary SinghKhurai Thoidingjam Leikai,Imphal East,Pin No - 795010 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-04-28 : 03:31:40
|
| Right Click on target database ---> Tasks ---> Import DataOn first "Data Source" page, select MS Excel as datasource... click browse to open your source excel file ...move next and on 5th page of wizard select your desired sheet and follow the wizard--------------------------http://connectsql.blogspot.com/ |
 |
|
|
raghuveer125
Constraint Violating Yak Guru
285 Posts |
Posted - 2011-04-28 : 03:31:46
|
| CREATE EXCEL FILE IN C DRIVE AND NAME DEMO.xlsdemo.xls data"cstid namea amount postcode statuss123 XYZ 23$ XXYY Active124 XYZ 23$ XXYY Active124 XYZ 23$ XXYY Active" and save next run thisSELECT * into #temp FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=C:\demo.xls', [Sheet1$])--This data will import in --#temp tableselect * from #Temp----------SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0','Excel 12.0;Database=c:\Demo.xlsx', [Sheet1$])Raghu' S |
 |
|
|
|
|
|