Can´t delete foreign key

  • Hi there,

    I try to delete a foreign key with

    ALTER TABLE [dbo].[Projektplanung] DROP CONSTRAINT [Projektplanung$tblLookupCountriesProjektplanung]
    GO

    But I have to cancel it and get Err 3737 afterwoods as it doesn´t finish. This worked for months now as this is built into a script where I delete the constraint and build it again after importing data into the table.

    As this command works with 50 more tables and I get this error on 3 tables since today I´m very confused.

  • According to the MS documentation, error 3737 is "Could not delete file '%ls'. See the SQL Server error log for more information."

    What error message are you seeing?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Supplement:

    As I found out there are 3 more constraints to the same table [tblLookupCountries] which cannot be deleted.

  • Sachers wrote:

    Supplement: As I found out there are 3 more constraints to the same table [tblLookupCountries] which cannot be deleted.

    OK, you made it sound like this was something which used to work and suddenly stopped working today. It seems that this is not the case, based on your supplementary info.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Never mind, my message was 3727, not 3737.

    Is there a lock on the table? I got the same message number when I cancelled a drop constraint query which was waiting for a lock to be released.

    Msg 3727, Level 16, State 0, Line 1

    Could not drop constraint. See previous errors.

    Query was canceled by user.

    • This reply was modified 2 years, 3 months ago by  Ed B.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply