Friday, March 23, 2012

Rename database

I have set the database to single user mode and want to rename the database.
However, it shows the following message:
To change the NAME, the database must be in state in which a checkpoint can
be executed.
I have restart the sql server service but it still shows the above message.
What should I do?
Best Regards,
IvanHi Ivan
I get a different error if I am not connected to the single user database in
SQL 2005, but I can rename a database in single user mode if I am connected
to it or if no-one else is connected to it.
I assume you are using SQL 2000? Is anyone else connected to the database?
John
"Ivan" wrote:
> I have set the database to single user mode and want to rename the database.
> However, it shows the following message:
> To change the NAME, the database must be in state in which a checkpoint can
> be executed.
> I have restart the sql server service but it still shows the above message.
> What should I do?
> Best Regards,
> Ivan
>
>|||In SQL2k with single user I can rename database easily.
Please check other settings also.
Regards
Amish Shah|||The database is in Single User mode and I have restart the SQL Server 2000
to ensure no one is connect to the database.
However, it still shows that error message.
Ivan
"amish" <shahamishm@.gmail.com>
'?:1147525165.494414.185770@.j33g2000cwa.googlegroups.com...
> In SQL2k with single user I can rename database easily.
> Please check other settings also.
> Regards
> Amish Shah
>|||Is the database READ_ONLY? It must be writable before it can be renamed.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ivan" <ivan@.microsoft.com> wrote in message
news:eg3ONfrdGHA.3484@.TK2MSFTNGP04.phx.gbl...
> The database is in Single User mode and I have restart the SQL Server 2000
> to ensure no one is connect to the database.
> However, it still shows that error message.
> Ivan
> "amish" <shahamishm@.gmail.com>
> '?:1147525165.494414.185770@.j33g2000cwa.googlegroups.com...
>> In SQL2k with single user I can rename database easily.
>> Please check other settings also.
>> Regards
>> Amish Shah
>|||Hi
If you make the database the current database and then use
ALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
you should not need to reboot the server.
If you reboot the server and someone connects to the database before you
then you will have a problem.
John
"Ivan" wrote:
> The database is in Single User mode and I have restart the SQL Server 2000
> to ensure no one is connect to the database.
> However, it still shows that error message.
> Ivan
> "amish" <shahamishm@.gmail.com>
> '?:1147525165.494414.185770@.j33g2000cwa.googlegroups.com...
> > In SQL2k with single user I can rename database easily.
> > Please check other settings also.
> >
> > Regards
> > Amish Shah
> >
>
>sql

No comments:

Post a Comment