Showing posts with label adatabase. Show all posts
Showing posts with label adatabase. Show all posts

Thursday, March 29, 2012

Database name with point in it (mail.archive.mdf) not recognised in query analyser of SQL

Apparently the query analyser of sql server does not recognise a
database with a point in it, like
mail.archive.mdf

I receive the following error when I use it:

Server: Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'mail'. No entry
found with that name. Make sure that the name is entered correctly.

Please help, thanks
Premselect * from master..sysdatabases
where name ='mail.archive'

mdf is not part of the name

Denis the SQL Menace
http://sqlservercode.blogspot.com/

Prem wrote:
> Apparently the query analyser of sql server does not recognise a
> database with a point in it, like
> mail.archive.mdf
> I receive the following error when I use it:
> Server: Msg 911, Level 16, State 1, Line 1
> Could not locate entry in sysdatabases for database 'mail'. No entry
> found with that name. Make sure that the name is entered correctly.
> Please help, thanks
> Prem|||Prem (premmetje@.zonnet.nl) writes:
> Apparently the query analyser of sql server does not recognise a
> database with a point in it, like
> mail.archive.mdf
> I receive the following error when I use it:
> Server: Msg 911, Level 16, State 1, Line 1
> Could not locate entry in sysdatabases for database 'mail'. No entry
> found with that name. Make sure that the name is entered correctly.

Need to use brackets or double quotes for identifiers with characters
that are not identifier characters normally:

USE [mail.archive.mdf]

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx