SQL Naming Issue in SELECT statement *** NEWBIE NEEDS HELP ***

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have just started programming in .net and have a SQL issue.

I have a "SELECT * INTO HOST FROM 105DW.dbo.HOST" statement that is driving
me nuts. I know that it has something to do with the 105DW naming of the db
because when I export it to DW105 and refer to it as DW105.dbo.HOST is works
fine. I have tested it in qurery designer and get the same issue. Searching
for rules on calling db's beginning w/ numerics as well as db names
containing spaces has not proved very fruitful.

HELP!!!
 
The said:
I have a "SELECT * INTO HOST FROM 105DW.dbo.HOST" statement that is
driving me nuts. I know that it has something to do with the 105DW
naming of the db because when I export it to DW105 and refer to it as
DW105.dbo.HOST is works fine. I have tested it in qurery designer and
get the same issue. Searching for rules on calling db's beginning w/
numerics as well as db names containing spaces has not proved very
fruitful.

Ref: SQL Server Books Online

The T-SQL help for CREATE DATABASE says "Database names must be unique
within a server and conform to the rules for identifiers."

Those rules are a bit harder to find - they're titled "Using Identifiers" in
"Accessing and Changing Relational Databases".

You can't normally start an identifier with a number, as you have found.

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top