I am trying to delete a row from a table that has a FK to
another table. I delete that relationship, delete the row
but when i want to create the relationship again i get
this error:
- Unable to create relationship 'FK_TAI00812_TAI00804'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL
Server]Column 'dbo.TAI00804.C_APL_SBCX' is not of same
collation as referencing column 'TAI00812.C_APL_SBCX' in
foreign key 'FK_TAI00812_TAI00804'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not
create constraint. See previous errors.
Can anyone help me please?Hi Claudy,
From the error message it looks like the collation of primary key and the
referencing foreign key is not same.
use sp_help on both the tables and see the Collation of these two columns.
You can change the collation using ALTER TABLE, but before that you may want
to understand the implication of the collation change at the column level.
--
Thanks
Yogish|||I'm having the same problem. On my development database, I have no problem in creating the foreign key constraint, but on the production databases it doesn't work!
albert@.vanbiljon.com
> I am trying to delete a row from a table that has a FK to
> another table. I delete that relationship, delete the row
> but when i want to create the relationship again i get
> this error:
> > - Unable to create relationship 'FK_TAI00812_TAI00804'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL
> Server]Column 'dbo.TAI00804.C_APL_SBCX' is not of same
> collation as referencing column 'TAI00812.C_APL_SBCX' in
> foreign key 'FK_TAI00812_TAI00804'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not
> create constraint. See previous errors.
> > Can anyone help me please?
User submitted from AEWNET (http://www.aewnet.com/)|||Guest
It is a good practice to create a relationship PK\FK between columns defined
as INT,SMALLINT.... and not VARCHAR(n)
It seems that you have a different collation in two tables.
"Guest" <Guest@.aew_nospam.com> wrote in message
news:O8Y154dOFHA.3512@.TK2MSFTNGP15.phx.gbl...
> I'm having the same problem. On my development database, I have no problem
in creating the foreign key constraint, but on the production databases it
doesn't work!
> albert@.vanbiljon.com
> > I am trying to delete a row from a table that has a FK to
> > another table. I delete that relationship, delete the row
> > but when i want to create the relationship again i get
> > this error:
> > > - Unable to create relationship 'FK_TAI00812_TAI00804'.
> > ODBC error: [Microsoft][ODBC SQL Server Driver][SQL
> > Server]Column 'dbo.TAI00804.C_APL_SBCX' is not of same
> > collation as referencing column 'TAI00812.C_APL_SBCX' in
> > foreign key 'FK_TAI00812_TAI00804'.
> > [Microsoft][ODBC SQL Server Driver][SQL Server]Could not
> > create constraint. See previous errors.
> > > Can anyone help me please?
> User submitted from AEWNET (http://www.aewnet.com/)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment