Saturday, February 25, 2012

Can't create a once existed database with its name

Hello, there,
Some time ago, there was a database with a name sts_servername_1.
God knows what I did, but it's now gone. I most probably have deleted it, or
maybe detached and never reatached. The fact is, I don't care about it and
its data anymore. I want it gone. There are no files of it anywhere. I just
want to create a new blank database with a same name.
And I can't. It says "database already exists". But running sp_databases
doesn't show it. Also if I try to "drop database" it says there's no such
database in the system catalogue. Could you please help me do something?
Thanks,
Mantvydas
hi Mantvydas,
Mantvydas wrote:
> Hello, there,
> Some time ago, there was a database with a name sts_servername_1.
> God knows what I did, but it's now gone. I most probably have deleted
> it, or maybe detached and never reatached. The fact is, I don't care
> about it and its data anymore. I want it gone. There are no files of
> it anywhere. I just want to create a new blank database with a same
> name.
> And I can't. It says "database already exists". But running
> sp_databases doesn't show it. Also if I try to "drop database" it
> says there's no such database in the system catalogue. Could you
> please help me do something?
> Thanks,
> Mantvydas
it sometimes happens that db names become '', thats' to say the relative
column [name] have been cleared... o not ask why.. I do not know...
try executing
SELECT * FROM master..sysdatabases
and see if you have an entry with [name] = ''
if this is the case, verify qhet the [filename] colum reports... that's the
physical data file to which the '' db points to..
rename the database accordingly and verify everithings ok
(http://msdn.microsoft.com/library/de..._dbcc_00gy.asp)
eventually drop the db
(http://msdn.microsoft.com/library/de...de-dz_82lh.asp)
if this is a viable solution...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

No comments:

Post a Comment