Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi there. We're doing a save on a MS Great Plains with SQL Server screen and get the following error:
"A save operation on table 'WS_Time_Sheet_TRX_WORK' failed because a database constraint was violated."If I hit More Info it says:
[Microsoft][ODBC SQL Server Driver][SQL Server]INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_WS10702_UPR00100'. The conflict occurred in database 'NSP', table 'U00100PR', column 'EMPLOYID'.I know these messages probably make perfect sense to you guys, but I'm a newbie. Can you point me in the right direction? My thinking is that maybe I should force the foreign key constraint using the "WITH NOCHECK" option or maybe the wrong data type is mapped between the two tables sharing the Foreign Key and the key should be deleted and recreated.
Any help you can provide would be most appreciated! Assume that I'm a newbie and that I know very little. You won't hurt my feelings if you "dumb it down" so I can understand where to begin! lol I'm not even entirely sure I know where to look to edit the connection in the first place.

Off the SQL site:
A foreign key constraint allows certain fields in one table to refer to fields in another table. This type of constraint is useful if you have two tables, one of which has partial information, details on which can be sought from another table with a matching entry. A foreign key constraint in this case will prevent the deletion of an entry from the table with detailed information if there is an entry in the table with partial information that matches it.

Thanks guys. This kind of info from another source is helpful. Kind of like getting a second opinion from a doctor. :-)
But how do I make a fix or make a change to the database relationship? where do I go to view and edit the SQL? Enterprise Manager?

It looks like you are trying to insert an EMPLOYID value into the table UPR00100, which requires a similar EMPLOYID value to already exist in the WS10702 table. (Foreign Key constraint)
You can view the Index/Relationships through Enterprise Manager. Expand the NPS database, select 'Tables', right-click the UPR00100 table and select 'Design Table'. Now right-click the Design form and select 'Indexes/Keys'

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |