SQL Server: drop a FK constraint, which is not foreign key -
i using sql server 2008 , management studio. doing web project, has tool automate tables/relationships creation.
my web project reveals error:
unsuccessful: alter table tester add constraint fk_c6c4bf4s2rvp56a32nnruww2b foreign key (game) references game
column 'game.id' not same data type referencing column 'tester.game' in foreign key 'fk_c6c4bf4s2rvp56a32nnruww2b'
however, when ran following in management studio:
alter table dbo.tester drop constraint fk_c6c4bf4s2rvp56a32nnruww2b
i following:
msg 3728, level 16, state 1, line 1
'fk_c6c4bf4s2rvp56a32nnruww2b' not constraint.
msg 3727, level 16, state 0, line 1
not drop constraint. see previous errors.
i confused. type of constraint fk_c6c4bf4s2rvp56a32nnruww2b
?
how can remove it?
thanks , regards.
there no such constraint!
the first error says could not create constraint since datatypes of 2 columns involved (game.id
, tester.game
) not match.
what should check how you're creating fk constraint leads first error - , explicitly give fk constraint meaningful name!
Comments
Post a Comment