"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Before you immediately start doing stuff to it, here's a snippet of *really* useful information from that blog: never detach a suspect database.

Edit: Also. The safest way, if you can't just reset the status and bring it back online is to restore it from backups. Putting a db in emergency mode and running a checkdb with repair_allow_data_loss is your very last resort.

Still have some holiday shopping to do for the geeks in your life? While toys, clothing, games, and gift cards are still viable options for your friends and family, there’s more reason than ever to consider gadgets and software.

Msg 1505, Level 16, State 1, Line 1The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.photo_detail_new' and the index name 'PK_photo_detail_new_try'. The duplicate key value is (2004707587).DBCC results for 'Photos'.

Is that index new or has it been there for a while? (i only ask because the naming is kinda weird). Is the database in a state where you can start looking at scripting out the create for the index and primary key, drop the index and pk, and then investigate whether or not there are duplicate primary key values, resolve that, and then re-create the index and pk? I am assuming that it's complaining about duplicate values for the PK, based on the name (since there's no schema info). Also, is that the clustered index that its referring to? If this is a large table, dropping that could be a very bad idea from a performance standpoint (removing the clustered index turns it into a heap, which is going to get ugly for large tables). Also, what's your backup situation looking like - that may honestly be the fastest method? It also kinda determines how aggressive you can be with this and I honestly can't say I'm comfortable recommending anything without knowing that.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Well there you go! And it shouldn't have allowed that. Make sure you run another checkdb and take a full backup ASAP (I would also recommend trying to store your backups on a different set of drives than the SQL Server's).