Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database Name including a space

Status
Not open for further replies.

Phil99

Programmer
Jul 12, 2002
32
0
0
GB
Hi

I'm trying to access a database, where the database name has a space in the name: ICore DB

This is causing an issue is Query Analyser when I attempt to run a query such as

select count(*)
from ICore DB.dbo.tblCountry

Is there a way to alias the Database name or can the syntax above be modified to allow the query to run.

Thanks

Phil
 
select count(*)
from [!][[/!]ICore DB[!]][/!].dbo.tblCountry

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Code:
Select count(*)
from [ICore DB].dbo.tblCountry

All reserved words and some strange names must be included in square brackets to make the query to run.

Borislav Borissov
VFP9 SP1, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top