April 20, 2009 at 3:08 am
Hi All,
I am having a database named DA-Profiler.
While running the below query
exec sp_msforeachdb 'use ? exec sp_spaceused'
i got the following error
“Could not locate entry in sysdatabases for database 'DA'. No entry found with that name. Make sure that the name is entered correctly.”
The query is working fine with all other databases except this database.
This error occurred as the database name contains “–“ .
Can anyone suggest me a work around for this without renaming the database.
Thanks in advance.
April 20, 2009 at 3:17 am
Try this
exec sp_msforeachdb 'use [?] exec sp_spaceused'
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 20, 2009 at 3:36 am
Thank You so much.
It works.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy