By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

Getting NULL value when Importing spread sht to sql table

P: 1
Anyone have an idea why i get null values when i import data from a ms spread sheet in a sql tbl. The table elemet(Spread sheet) in question contains alpha numerics. The sql table is populated with "NULL" when the value is numeric only. Example: A-ASP21A1-- imports perfect
6500012111-- results in "NULL" in the sql table element
Jan 23 '08 #1
Share this Question
Share on Google+
5 Replies


drhowarddrfine
Expert 5K+
P: 7,435
This should be moved to the proper forum but not sure which one.
Jan 23 '08 #2

kadghar
Expert 100+
P: 1,295
This should be moved to the proper forum but not sure which one.
Since its an MS spreadsheet, i would say he migth be using SQL Server as well.
Jan 23 '08 #3

100+
P: 112
Change the sql table field type to nvarchar.

Use this statement to import from excel. I got the same kind of data and imported from excel.
Expand|Select|Wrap|Line Numbers
  1. Select * Into[dbo].[table]
  2. FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
  3.                'Excel 8.0;Database=C:\Documents and Settings\admin\Desktop\excel.xls;IMEX=1',
  4.                'SELECT * FROM [Sheet1$]')
Jan 24 '08 #4

ck9663
Expert 2.5K+
P: 2,878
Anyone have an idea why i get null values when i import data from a ms spread sheet in a sql tbl. The table elemet(Spread sheet) in question contains alpha numerics. The sql table is populated with "NULL" when the value is numeric only. Example: A-ASP21A1-- imports perfect
6500012111-- results in "NULL" in the sql table element

what's the data type of the target table?

-- ck
Jan 24 '08 #5

jhardman
Expert 2.5K+
P: 3,405
what's the data type of the target table?

-- ck
Are you just importing with SQL Server?
Jan 24 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.