Skip to content
Advertisement

Insert columns into new table where one of the columns doesn’t allow null values

I am attempting to insert 50 rows at a time from one table into another, however I am unable to bypass the ‘Not Null’ column in the table I am attempting to INSERT INTO.

Please note I am not able to alter that column so it accepts nulls.

I have 2 tables (table 1 and table 2). I am inserting 2 columns from table 1 into table 2 (table 2 is currently empty). The problem is that table 2 has a third column which cannot have null values.

This is what I have so far.

The problem is that Column 3 in Table 2 does not exist in Table 1 so there is nothing I can insert into Table 2 from Table 1 to populate the column that does not allow nulls in Table 2.

Advertisement

Answer

You can select a constant

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement