Hi @Laura Ijewere ,
>Msg 515, Level 16, State 2, Line 1 Cannot insert the value NULL into column 'VendorId', table 'Parminder.dbo.FactSales'; column does not allow nulls. INSERT fails.
you didn't specify the [ProductId],[VendorId] column in your insert statement, the SQL Server will insert the value NULL into these columns, but you have defined these columns not nulll in the table [FactSales]), and that why you get this error.
>>>hi, so I tried allowing Nulls but it ended up not populating anything in the vendorid and productid columns,i mean those two col showed as nulls for all rows.i don't know why
This is normal behavior. You have allowed [ProductId], [VendorId] to be NULL, but you still have not specified [ProductId], [VendorId] in your insert statement. SQL Server will insert NULL values in these two columns by default. And the foreign key columns can be NULL or duplicate.
Check this post for more details, and please view the MS doc—Create Foreign Key Relationships for the Limits and restrictions.