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
 General SQL Server Forums
 New to SQL Server Programming
 SSIS error

Author  Topic 

Ginger8990
Starting Member

28 Posts

Posted - 2011-07-30 : 22:38:45
we created SSIS import package, it worked fine but the scheduled job failed to run after a column added.

The job history shows :cannot insert value NULL into the column 'LoanNO' Table xxx column doesn't allow NULL ....

I am new to SQL programming. I am not sure how to fix this?


Please help!!!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-07-31 : 01:43:17
the reason is because you've added column as a NOT NULL column but you've not mapped that column inside SSIS package which is causing it to insert a NULL value into it that's raising error. you need to open the package and in data flow task open the source and include this new column also in flow and come to destination task and do correct mapping.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Ginger8990
Starting Member

28 Posts

Posted - 2011-07-31 : 18:41:10
Thank you for your reply to me.
We did map the column to LoanNo but I am not sure the column was added to SQL table in SQL database.

Can I ask you how to add a column in the SSIS 2008 package? Does it need to add in the table of SQL DB or does it need to add in the SSIS package directly?
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-07-31 : 19:12:02
Is LoadNo the new column? If so then it has been added to the table and either hasn't been added to the import package or the package is delivering a null.

The mapping is in the package - what do you mean when you say the column has been mapped if you then ask how to add it to a package, doesn't make sense.

You need to edit the package - it depends what sort of task is involved but you will need to refresh the source and destination metadata then add the mapping for the new column.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Ginger8990
Starting Member

28 Posts

Posted - 2011-07-31 : 22:00:39
Yes, the loanNO is the new column. It is not me that added the column, it was someone else. But the person is on vacation.

When I looked column (Column 18 ) in SSIS OLEDB source, it was mapped to LoanNo.
How to correct this NULL issue?
____________________

quote:
Originally posted by nigelrivett

Is LoadNo the new column? If so then it has been added to the table and either hasn't been added to the import package or the package is delivering a null.

The mapping is in the package - what do you mean when you say the column has been mapped if you then ask how to add it to a package, doesn't make sense.

You need to edit the package - it depends what sort of task is involved but you will need to refresh the source and destination metadata then add the mapping for the new column.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-08-01 : 04:34:04
1. make sure you're getting some NOT NULL values from your source. (use data viewer in data flow tab in your package for this)
2. Make sure you dont have a step inside package which is specifically assigning it to NULL(derived column may be)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -