Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Null Values shows while importing from excel to Sql Expand / Collapse
Author
Message
Posted Wednesday, November 07, 2012 10:54 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 3:52 AM
Points: 131, Visits: 248
Hi,
I have Excel File with following coloumn and sample data.

example,

No TranRefNo
1 1111
2 2222
3 3333
4 4444
5 5555
6 6666
7 7777
8 8888
9 alstsh1234
10 absgya1234


The DataType of TranRefNo is General in Excel
Problem is,
When I import the Excel File in SQL values of TranRefNo till No 8 imports correctly,
but, for 9 and 10 where TranRefNo is alphanumeric Values it shows as NULL Values.

Please give me solution,i need this for urgent requirement.
I had also tried in SSIS but same problems occurs.

Is there other alternative in SSIS.

Thanks in Advance!

Post #1382261
Posted Wednesday, November 07, 2012 11:00 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, April 13, 2014 5:18 PM
Points: 90, Visits: 418
avdhut.k (11/7/2012)
Hi,
I have Excel File with following coloumn and sample data.

example,

No TranRefNo
1 1111
2 2222
3 3333
4 4444
5 5555
6 6666
7 7777
8 8888
9 alstsh1234
10 absgya1234


The DataType of TranRefNo is General in Excel
Problem is,
When I import the Excel File in SQL values of TranRefNo till No 8 imports correctly,
but, for 9 and 10 where TranRefNo is alphanumeric Values it shows as NULL Values.

Please give me solution,i need this for urgent requirement.
I had also tried in SSIS but same problems occurs.

Is there other alternative in SSIS.

Thanks in Advance!



TransRefNo has to be TEXT category not GENERAL (use TEXT TO COLUMN for most accurate result) & database table will have to be VARCHAR(X)

That should fix it.
Post #1382263
Posted Wednesday, November 07, 2012 11:22 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 3:52 AM
Points: 131, Visits: 248
Thanks!
Post #1382268
Posted Wednesday, November 07, 2012 11:56 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, April 13, 2014 5:18 PM
Points: 90, Visits: 418
No problem, hope it all worked
Post #1382281
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse