views:

90

answers:

3

Here is the create statement:

create table dbmonitor.DBMON_DATABASE_TYPE (
        DATABASE_TYPE_ID BIGINT IDENTITY NOT NULL,
       DispName NVARCHAR(255) null,
       primary key (DATABASE_TYPE_ID)
    )

and this is the error I get:

13:40:57,685 ERROR [TestRunnerThread] SchemaExport [(null)]- The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 24,Table name = DBMON_DATABASE_TYPE ]
The table name is not valid. [ Token line number (if known) = 1,Token line offset (if known) = 24,Table name = DBMON_DATABASE_TYPE ]
A: 

Check this link for valid naming conventions for sql tables.

EDIT: Check this link which talks about some bug related to table name is invalid.

http://support.microsoft.com/kb/951932

Sachin Shanbhag
The OP is running on SQL Server Compact Edition - that might make a difference...
marc_s
I'm starting to think you are not allowed to have a prefix dbmonitor. for table names...
Jacob Nelson
+1  A: 

I'm not sure if dbmonitor is meant to be a schema name, but according to the documentation for the SQL CE CREATE TABLE statement, you cannot include a schema name with the table name.

Contrast this for SQL Server 2005 Compact Edition (just showing the initial part of the statement),

CREATE TABLE table_name 
   ( { < column_definition > | < table_constraint > } [ ,...n ] 
   ) 

with this for SQL Server 2008:

CREATE TABLE 
    [ database_name . [ schema_name ] . | schema_name . ] table_name 
adrift
+2  A: 

Possibilities:

  1. Is dbmonitor the name of your database? You can't put a . in a table name.
  2. Do you mean CREATE TABLE dbmonitor.dbo.DBMON_DATABASE_TYPE?
  3. Did you try CREATE TABLE DBMON_DATABASE_TYPE?
egrunin