Showing posts with label excel. Show all posts
Showing posts with label excel. Show all posts

Friday, March 9, 2012

Getting nulls in SQL2005 table while importing from EXCEL spreadsheet

I am trying to import an Excel Spreadsheet into SQL2005. There is a column in the spreadsheet that has character values, and numbers. I have formatted the numbers as text on the spreadsheet. I have declared the column on the table as char/varchar/nchar, but whatever I do, the numbers don't get imported into the table, but show up as nulls. Any idea why?

Thanks

Mangala

Search the forum. It's a common issue.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1872950&SiteID=1

Getting null values while importing data from excel sheet to sqql server

Hai Friends,

Actually i want to import excel sheet in to sql server tables. I am writing the following query SELECT * FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Book1.xls','SELECT * FROM [Sheet1$]') and able to retireve the data but the problem is the data present in the excel sheet is

Usernamepasswordhello1234512345hellohai-123haihaihaihellohello-123

Once i run this query i am getting it as

Username Password hello NULL
NULL hello
hai-123 haihai
haihello hello-123
can anybody please help me out in this case and how to solve this problem and if you have any piece of code please pass it on to me and i am in very urgent need waiting for your replies thanks in advance.

Friends, what i mean to say is i am getting null values in the results.