I restored database to a new name and want to delete bads one,get error messa:
Cannot drop the database because it is being used for replication,how can I remove it?
Not knowing what the error message is, it's hard to suggest a solution.
If a database is being used for replication, then you'll need to remove the replication first, then drop it. But, are we talking about dropping the test restore? Why would it suddenly get used for replication? It shouldn't be. I suspect you have a lot more going on there than you're informing us. If you want help, you have to be as clear as you possibly can. Remember, we can't see what you can see and can't know things about your system that you know. All the information we have is what you tell us.
For example, just saying you have an error message. It could be a security error because you tried to login without permission. It could be a syntax error because of a typo. It could be that your backups are corrupt, so you restored a corrupt database and are still having problems. It could be a deadlock with some other transaction. It could be almost anything. See? So please, we're trying to help, but you've got to provide enough information for us to attempt to suggest useful answers.
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore RooseveltThe Scary DBA
Author of: SQL Server Query Performance Tuning
and SQL Server Execution Plans
Product Evangelist for Red Gate Software