thank you very much, i will try your suggestion. If it works fine then i will
inform you.
"Cowboy (Gregory A. Beamer) - MVP" wrote:
> Open a connection to the master database, not the database in question. Run
> the following:
>
> select spid from master..sysprocesses where dbid=db_id('DatabaseNameToDrop')
>
> This will give you a list of process connected to the database. You then
> have to run a kill command on each process. Rerun to make sure nobody is
> connecting. You can now detatch, drop, etc. the database.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "Mukilan.Ps." wrote:
>
> > I'm using ASP.Net and code behind 'vb'.SQL Server as backend. I want to
> > delete database at run time. If im deleting the databse using 'DROP DATABASE
> > databasename' its throwing exception ' Database currently in use'. How to
> > delete the databse during runtime. I have created a new command and
> > connection object for deleting the database.And i establish the connection
> > string to Master database before deleting the database. Please give me some
> > suggestion.
> >
> >
|