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.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 import data

Author  Topic 

hazz1977
Starting Member

3 Posts

Posted - 2007-01-25 : 09:50:40
hi,

im trying to import ther following data into a sql table.

column1 column2
23 ROW1
45 ROW2
796 ROW3
45 ROW4
WE ROW5
FT ROW6
HU ROW7
78 ROW8

once the import completes rows 5-7 return a null value

can anyone help?

cheers
Hazz

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-25 : 09:52:16
Force the first column to be a VARCHAR/NVARCHAR column data type!
The import wizard only examines the first few records to determine which datatype to use.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

hazz1977
Starting Member

3 Posts

Posted - 2007-01-25 : 09:57:34
i set the column to varchar and also tried setting it as nvarchar but it didn't help
Go to Top of Page

sshelper
Posting Yak Master

216 Posts

Posted - 2007-01-25 : 10:04:08
How are you importing the data? Is it from an Excel file? Since your first column contains a combination of numeric and alpha, your import application was able to determine that the data type of that column is numeric and anything that is not numeric it converts to NULL. There's an option that you can set in the connection string, called IMEX, where you can force it to convert everything to string.

As an example of the IMEX parameter, refer to the following links:

http://www.sql-server-helper.com/tips/read-import-excel-file-p02.aspx
http://www.sql-server-helper.com/tips/read-import-excel-file-p03.aspx

SQL Server Helper
http://www.sql-server-helper.com
Go to Top of Page

hazz1977
Starting Member

3 Posts

Posted - 2007-01-25 : 10:46:14
thanks for that.

do you know if there are any changes that can be made within the SSIS package to acheive the same result.
i.e by editing the data type column properties?

Go to Top of Page
   

- Advertisement -