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 |
|
leslieb
Starting Member
23 Posts |
Posted - 2008-07-23 : 21:16:24
|
I am only very new to SQL so am floundering. I am using SQL2005I try to import data and one colum has numbers and also numbers and letters ie 1234, 1236, 123RT, etc. I am importing from excel and the 123RT does not import unless there is a number/letters in the first line to be imported.Also when I run a query I get the number/letters 123RT but the straight numbers show as NULL.Can anyone help a newbie? |
|
|
dexter.knudson
Constraint Violating Yak Guru
260 Posts |
Posted - 2008-07-23 : 23:38:33
|
| yes this is frustrating. Is this a regular automated task or one-off? If it's one-off, try adding a blank space after the numbers in the columns in the first row where the column should be text. |
 |
|
|
leslieb
Starting Member
23 Posts |
Posted - 2008-07-24 : 01:42:50
|
It will be a regular process (daily) which we hope to automate in the future. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-24 : 02:57:45
|
| or add single quote in front of the valuesMadhivananFailing to plan is Planning to fail |
 |
|
|
leslieb
Starting Member
23 Posts |
Posted - 2008-07-24 : 19:54:17
|
| Unfortunately it is not that easy as the data is coming from an excel spreadsheet and would be 1,000 line on a slow day. The only way I have got it to work so far is to Cut and paste from Excel into Access, Export from Access to Excel and then import into SQL.I hope there is an easier way. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-25 : 02:59:31
|
| How are you importing data?Convert the data to varchar before importingMadhivananFailing to plan is Planning to fail |
 |
|
|
leslieb
Starting Member
23 Posts |
Posted - 2008-08-14 : 20:55:00
|
| I am using the 'Tasks' and then 'Import Data'.How do I convert before importing?If I use varchar and import direct from the Excel spreadsheet the codes with just numbers are fine but those with number and letters show as NULL. I have tried the same using text and nvarchar with the same result. |
 |
|
|
|
|
|