Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table does not accept nulls
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01395304
Message ID:
01395311
Views:
48
>>>I've got a weird situation. Our Internal Affaris bureau has a routine that was written by someone else that is supposed to pull all MPD Employee data from an Oracle database. That works. The data is pulled into a free standing table, then each record is checked against the employees table in a SQL Server (2005) using a parameterized remote view. If the employee isn't found, the record is inserted into the SQL table. The error message I get says the SQL table does not allow nulls in the "identity_column" column. Checking the record in the remote view, the data is there and is the correct data type (integer). Thinking the table might have been corrupted, I scripted it, exported the data to a csv file, pulled it into VFP checked for nulls and dups and found none, then dropped and rebuilt the table and imported the csv file back. Still getting the same fubar.
>>>
>>>Anybody got a clue?
>>
>>Is it an actual identity column in sqlserver? Does it have the identity property? Just a SWAG, but did you issue SET IDENTITY_INSERT < tablename > ON for the table before inserting? Usually the message is different though, something similar to Cannot insert explicit value for identity column in table 'IdentityTable' when IDENTITY_INSERT is set to OFF. Your message is more typical of columns defined not as identity but where NOT NULL was included when the table was created but no value is being passed for the insert. There are typically different messages when you attempt to update the IDENTITY column with values that already exist. Can you post any of your code?
>
>No, it isn't an "identity column", that is just the name, and it should be a unique number.

Are you doing it one record at a time? Is it possible to see the actual insert command using SQL Profiler?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform