I have a script that gives an error when being executed:
Msg 1505, Level 16, State 1, Server CBR07I300FVA1, Line 1
CREATE UNIQUE INDEX terminated because a duplicate key was found for
index ID 17. Most significant primary key is '44'.
The statement has been terminated.
The script contains thousands of lines of queries so I have no idea where the error comes from in the script. Is there a way to know what “index ID 17” stands for?
Insert
printstatement before every significant step (say,create unique index) in the script and you’re done.It’s usually done like this: