"bitunwise" <mc*****@jetcam.net> wrote in message
news:79**************************@posting.google.c om...
I had a problem today where I could not see column names and all
tables had a _1 after them when viewing a Sql Server view in
Enterprise Manager
e.g.
TableName Company when added to the view would be named Company_1 and
the only columns available were 1 which was *(All Columns)
After looking through the news groups I saw several occurrences of
this problem but no answers that gave a fix
After some investigation I found that it is caused when the database
name in SqlServer has a . in it!
Test1 >> Fine the view designer works fine
Test1.6 >> Problems as listed above
I don't see why Enterprise Manager allows database names with .'s if
it is going to create such problems.
This is a documented bug:
http://support.microsoft.com/default...&Product=sql2k
It would probably be best to avoid using unusual characters in database
names, and especially full stops/periods. Since . is used in MSSQL to
separate parts of object names, there is obvious potential for confusion,
and you will have to quote the database name to use it in code anyway.
Many people prefer to use Query Analyzer for all object creation and
programming, as it is a very 'direct' interface to MSSQL, so problems are
more immediately obvious. For example, an error is raised in QA:
create database Test1.6
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '.6'.
Enterprise Manager is presumably adding brackets behind the scenes - you see
Test1.6, but what EM actually executes is this:
create database [Test1.6]
See "Delimited Identifiers" in Books Online for more information.
Simon