I've been trying to fix this problem for hours now and I have no idea what causes it. I'm trying to drop tables in MSSQL Server (I need to start from scratch) and whenever I'm using the statement
DROP TABLE dbo.Manages;
I get this message:
Could not drop object 'dbo.Manages' because it is referenced by a FOREIGN KEY constraint.
Problem is, I have three tables left and all of them contain foreign keys(they're linked with eachother). It turned out that I can't delete either and I'm stuck. I tried dropping foreign keys first, but
ALTER TABLE dbo.Manages DROP FOREIGN KEY Mgr_start_date;
wouldn't work. I know there's also a way to write it like this:
ALTER TABLE dbo.Manages
DROP FOREIGN KEY fk_(...)
Yet when I created the foreign keys, I didn't use fk_, I just simply stated
ALTER TABLE dbo.Department
ADD FOREIGN KEY (Mgr_start_date)
REFERENCES dbo.Manages(Mgr_start_date);
Any help would be highly appreciated. I'm fairly new to SQL, but I really want to make this work. I tried some solutions from this forum like using FOREIGN_KEY_CHECKS = 0
and then setting it to 1, but it wouldn't work either.