dbTalk Databases Forums  

SSIS and 'Cannot insert the value NULL into column 'myField''

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss SSIS and 'Cannot insert the value NULL into column 'myField'' in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
larry
 
Posts: n/a

Default SSIS and 'Cannot insert the value NULL into column 'myField'' - 03-19-2006 , 04:30 PM






*simple problem and newbie has no clue..* ;-)

I have to copy data from one sql server table into another sql server
table. I'm using SSIS for the first time...

I'm using a simple data type conversion to move the data from one table
into another and this works fine for some tables. In another table, I
get the error:

"Cannot insert the value NULL into column 'myField', table
'ISCTest.dbo.tblmyTableXY'; column does not allow nulls. INSERT fails."

This sounds really reasonable to me, because there is a field 'myField'
in the destination table which really does not allow NULLs and there is
no such field in the source table. I would just like to give a static
value (='1') into this field, but I really can't figure out how. I
tried to set a variable, but I don't know how to assign the value of
the variable to this field...

Any hints are greatly appreciated!


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: SSIS and 'Cannot insert the value NULL into column 'myField'' - 03-20-2006 , 03:08 PM






Hello Larry,

Have a look at the derived column transform. You can do what you want in
there.

Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
*simple problem and newbie has no clue..* ;-)

I have to copy data from one sql server table into another sql server
table. I'm using SSIS for the first time...

I'm using a simple data type conversion to move the data from one
table into another and this works fine for some tables. In another
table, I get the error:

"Cannot insert the value NULL into column 'myField', table
'ISCTest.dbo.tblmyTableXY'; column does not allow nulls. INSERT
fails."

This sounds really reasonable to me, because there is a field
'myField' in the destination table which really does not allow NULLs
and there is no such field in the source table. I would just like to
give a static value (='1') into this field, but I really can't figure
out how. I tried to set a variable, but I don't know how to assign the
value of the variable to this field...

Any hints are greatly appreciated!




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.