473,513 Members | 2,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The "alter table" statement conflicted with Foreign key consrtaint

15 New Member
I have created Two tables

1]EmployeeTable
--------------------------
EmpID [ bigint] [PrimaryKey]
EmpName [ varchar(50)]
AccessLevelID [bigint ] [ Foreign Key]

2]AccessLevelTable
-----------------------------
AccessLevelID [ bigint ] [ PrimaryKey ]
AccessLevelName [varchar(50)]


Now i am creating relationship between these two tables.
I select relationship option for first table.
Then I added new relationship by selecting primary table field and foreign key table field.
Afterall when i am trying to save these changes I get one error
"The ALTER table Statement conflicted with foreign key constraint".
Can anyone help me as soon as possible.
Thanks in advance
Nov 26 '08 #1
3 7236
ck9663
2,878 Recognized Expert Specialist
What relationship are you creating on which field?

-- CK
Nov 27 '08 #2
bougie
11 New Member
wish this could help:
check the identity property in your primary key table...
Aug 10 '10 #3
NeoPa
32,558 Recognized Expert Moderator MVP
Check the properties of [EmployeeTable].[AccessLevelID] to make sure there is nothing which is incompatible with the field being used as a foreign key. The one that first springs to mind is the Nullable property (Allow Nulls).

Welcome to Bytes!
Aug 10 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
22614
by: Prince Kumar | last post by:
Is there any way I can define an Unique constraint or unique index which allows more than one null values for the same column combination in DB2? ie, If my index is defined on (col3, col4) where both columns allow nulls, I want col3 + col4 to be unique, if one or both the columns have values. If both columns have nulls, it should allow more...
3
6645
by: Hans-Dieter Franz | last post by:
Hello, I have a problem with a Java user-defined stored procedure and the "alter sequence" statement. I use DB2 8.1.2 and had the same problem with 8.1.0, but not with 7.*. I get the following message: SQL0206N "dipf.AENDERUNGSLISTE_SEQ" ist in dem verwendeten Kontext ungültig.
2
7030
by: Alanoly J. Andrews | last post by:
Hi, I have two tables (that I know of) in a database that seem to be corrupted. All SQL statements on the tables hang, "select * from..", "select count (*) from", "delete from..". I can't even drop the tables as the "drop table..." statement, too, hangs. But the tables do exist as they show up in "describe table <tabname> ". A "create...
1
5468
by: Daniel Chou | last post by:
Hello, I have two questions about "not logged initially": 1. Before using "alter table tbname activate not logged initially", should the table be created with "not logged initially"? 2. After using "alter table tbname activate not logged initially", how to deactivate it?
0
3183
by: elvin | last post by:
Okay - apologize in advance for the length, but I want to make sure all you knowledgeable and helpful people have all the details you need to hopefully point my newbie rear in the right direction. I've got a fairly complex (a lot more complex than originally intended) database with three main tables. The database is designed to track...
2
3408
by: Larry R Harrison Jr | last post by:
I have an Access 97 database with 2 tables that have a one-many relationship. I have a SQL statement in the "one" table which I want to execute and insert 7 records into the "many" table, and I want them to be linked to the "main" table. Problem is, it won't let me run the SQL run as long as the one-many relationship is established in the...
9
18510
by: Tomba | last post by:
I have a really annoying problem, which i tried solving for almost 3 days now. (I googled in any variation i could think of, but i couldn't find anything that will help my stupid me understand:\) I'm trying to use a ALTER TABLE ALTER COULMN to change the datatype of a certain column in a table i'm importing by code from an .xls to my access...
5
4990
AccessIdiot
by: AccessIdiot | last post by:
Argh! Just when I think everything is working and I am doing one final test before showing it to the guys I built the db for, Access throws out a weird message and won't let me add a record. But only SOMETIMES. I am getting "You cannot add or change a record because a related record is required in table "tbl_Entrianment". The only thing that...
1
2132
by: Rahul Babbar | last post by:
Hi, I ran the scripts in a file from Command Line Processor and it gave the error for all the constraints being added, but not the indexes being added. For a simple statement like Alter table A add constraint A_const foreign key(col1) references B(col2);
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3255
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.