SQL server database cannot be detached "used for replication"

SQL 2005 on windows 2003
When try to detach a database I get the error  message that it cannot be detached because it's used for replication.

Under replication  There are no replications or publications specified.

I have found a few places that suggest running this:
"sp_removedbreplication dbname".
But it also says this which makes me cautious::
"This will remove all replication objects in the database"
Does this refer to  the SQL server objects that control replication or my data?

It may be overly cautious or literal to think that this may mean the tables in my  database
that were marked for replication when I had a failed attempted to set up replication,
but the language is ambiguous. Plus I found  reference some other guy wrote
that said something about it deleting his database, and "good thing I had a backup"

I tried  to disable replication from  mamagement studio, the wizard at the end tells me that it can't because
"the distributor has not been installed correctly"

What does this procedure "sp_removedbreplication"  really do ?
I need to free up this database to detach and move it.
I need to get this done today of possible

Thanks


awalkintheparkAsked:
Who is Participating?
I wear a lot of hats...

"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.

tigin44Commented:
Does this refer to  the SQL server objects that control replication or my data?
- Refers to the replicated object.. your data will be untouched.

sp_removedbreplication (Transact-SQL)

This stored procedure is executed at the Publisher on the publication database or at the Subscriber on the subscription database. The procedure removes all replication objects from the database in which it is executed, but it does not remove objects from other databases, such as the distribution database.
0

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.

Start your 7-day free trial
awalkintheparkAuthor Commented:
Ok, progress, I can now detach it, but when I try to copy it to another machine, window explorer tell me that its being used by another person or program.  If it was, SQL server wouldn't let me detach it. What's holding it open?
0
Gene_CypCommented:
Reboot the system to force any and all connections on it to close. Then try moving it.
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

awalkintheparkAuthor Commented:
"Reboot the system to force any and all connections on it to close. Then try moving it."

Already tried that. Same result.
0
Gene_CypCommented:
You can't copy the MDF when the SQL Server is running.

If you want to copy the MDF, you must either stop the SQL Server or just take the database offline. Copy the database and then bring it back online again.

1) Run SQL Server Management Studio,
2) Right click on the database -> Tasks -> Take Offline
3) COPY MDF
4) Right click on the database -> Tasks -> Bring Online

You can also try "backing up" the database and transferring the backup.
0
mikkilineniCommented:
Does the Other Machine have  the file with same Name.?
0
awalkintheparkAuthor Commented:
Surprisingly  explorer didn't ask overwrite when the same file existed in the target directory.  It would copy to another directory.

Thanks guys, there were useful suggestions from all. I had tried some of them myself before posting. This site is such a nice resource.  
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.