Hi,
I have two tables:
CREATE TABLE dbo.country
(
cntry_id VARCHAR(2) NOT NULL,
name VARCHAR(50) NOT NULL,
CONSTRAINT pk_country PRIMARY KEY (cntry_id)
CREATE TABLE dbo.city
(
city_id VARCHAR(3) NOT NULL,
name VARCHAR(50) NOT NULL,
cntry_id VARCHAR(2) NOT NULL,
CONSTRAINT pk_city PRIMARY KEY (city_id),
FOREIGN KEY (cntry_id) REFERENCES dbo.country(cntry_id)
)
I am trying to drop the fk constrait so I can then drop the table.
The FK definitley exists:
EXEC sp_fkeys country
pktable_qualifier pktable_owner pk_tablename ...
xxxxxx xxx country cntry_id ....
(DB name obscured)
But both
EXEC sp_dropkey foreign, country, city
EXEC sp_dropkey foreign, city, country
return
264 Error (17499) No foreign key for the table or view exists. sp_dropkey(263)
Does anybody know how to drop these keys?
Thank you in advance
Ryan