It happened to me when I had a primary key missing on the respected column (the identity column) in the db's schema.
I exported data between SQL servers, using SSMS Export tool and creating a new database, but didn't realize that it's exporting only the data, without keys.