Based on this topic I've encountered a problem with insertions.
My Tests
table contains:
TestID Name
1 test_insert_film
2 test_insert_writer
3 test_insert_location
4 test_delete_film
5 test_delete_writer
6 test_delete_location
I want to insert into my TestTables
the id's of the tests with the following sequence:
INSERT INTO TestTables(TestID)
SELECT TestID
FROM Tests
But I get:
Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'TableID', table 'FilmS.dbo.TestTables'; column does not allow nulls. INSERT fails. The statement has been terminated.
TestTables
contains 4 columns, one of them being TestID
. Why isn't this working?