'Unable to restore Database, Database is in use by session

I am using SQL Server 2005 and I am having an issue restoring my database I receive this message upon trying to restore my database.

Restore failed. (Microsoft.SqlServer.Express.Smo)

"System.Data.SqlClient.SqlError: RESTORE cannot process database 'AMOD' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Express.Smo)"

I have restarted the program I did not open any tables contained within the database and I still receive this message. I am new to SQL Server and this is my first time doing a restore. I appreciate any help provided.



Solution 1:[1]

Use Activity manager to kill resource dependencies in a script or else kill SPID as simple.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mitul Panchal