On Feb 24, 1:39 pm, sevenseeker <[EMAIL PROTECTED]> wrote:
> On Feb 23, 1:28 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote:> Jason,
>
> > As I think I stated, I did get the sql create command to work, but I
> > had to delete some of the identity tables that were already there. If
> > I do the sql create with the table in SQL Server, I receive the same
> > error.
>
> > I used the shell to do a query on the table I created:
> > tbl_TimeEntries, and it worked. So I think my connection string is
> > good. I'll have a look at SQL's error logs on Monday when I'm back at
> > work. Maybe I'll just re-delete the ID tables a second time and give
> > it another go as well.
>
> > This is weird stuff. It should "just work".
>
> I agree, sounds very strange here.  If it works on its own but will
> not work within TG then what is the problem?  I am guessing there is a
> setup_all() method at the very end of the model.py, that seems to be
> not detecting that you already have the db but why?
>

That's what I thought too, but there is no setup_all() in model.py
unless I create the skeleton using the Elixir flag. I tried it that
way too and I get a this similar error:

<with Elixir>

2008-02-25 14:30:36,780 sqlalchemy.engine.base.Engine.0x..90 INFO
SELECT [COLUMNS_1].[TABLE_SCHEMA],
 [COLUMNS_1].[TABLE_NAME], [COLUMNS_1].[COLUMN_NAME], [COLUMNS_1].
[IS_NULLABLE], [COLUMNS_1].[DATA_T
YPE], [COLUMNS_1].[ORDINAL_POSITION], [COLUMNS_1].
[CHARACTER_MAXIMUM_LENGTH], [COLUMNS_1].[NUMERIC_P
RECISION], [COLUMNS_1].[NUMERIC_SCALE], [COLUMNS_1].[COLUMN_DEFAULT]
FROM [INFORMATION_SCHEMA].[COLUMNS] AS [COLUMNS_1]
WHERE [COLUMNS_1].[TABLE_NAME] = %(COLUMNS_TABLE_NAME_1)s AND
[COLUMNS_1].[TABLE_SCHEMA] = %(COLUMNS
_TABLE_SCHEMA_1)s
2008-02-25 14:30:36,780 sqlalchemy.engine.base.Engine.0x..90 INFO
{'COLUMNS_TABLE_SCHEMA_1': 'dbo',
'COLUMNS_TABLE_NAME_1': 'visit'}
2008-02-25 14:30:36,780 sqlalchemy.engine.base.Engine.0x..90 INFO
CREATE TABLE visit (
        visit_key VARCHAR(40) NOT NULL,
        created DATETIME NOT NULL,
        expiry DATETIME,
        PRIMARY KEY (visit_key)
)


2008-02-25 14:30:36,780 sqlalchemy.engine.base.Engine.0x..90 INFO {}
2008-02-25 14:30:36,780 sqlalchemy.engine.base.Engine.0x..90 INFO
ROLLBACK
Unhandled exception in thread started by <bound method Server._start
of <cherrypy._cpserver.Server o
bject at 0x00AB1210>>
Traceback (most recent call last):
  File "c:\python24\lib\site-packages\cherrypy-2.3.0-py2.4.egg\cherrypy
\_cpserver.py", line 78, in _
start
    Engine._start(self)
  File "c:\python24\lib\site-packages\cherrypy-2.3.0-py2.4.egg\cherrypy
\_cpengine.py", line 110, in
_start
    func()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\startup.py", line 234,
 in startTurboGears
    ext.start_extension()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\visit\api.py", line 15
5, in start_extension
    create_extension_model()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\visit\api.py", line 17
4, in create_extension_model
    _manager.create_model()
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\visit\savisit.py", lin
e 39, in create_model
    class_mapper(visit_class).local_table.create(checkfirst=True)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\schema.py", line 300,
in create
    self.metadata.create_all(bind=bind, checkfirst=checkfirst,
tables=[self])
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\schema.py", line 1215,
 in create_all
    bind.create(self, checkfirst=checkfirst, tables=tables)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
1131, in create
    self._run_visitor(self.dialect.schemagenerator, entity,
connection=connection, **kwargs)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
1160, in _run_visitor
    visitorcallable(self.dialect, conn, **kwargs).traverse(element)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\visitors.py", line
 76, in traverse
    meth(target)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\compiler.py", line
 760, in visit_metadata
    self.traverse_single(table)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\visitors.py", line
 30, in traverse_single
    return meth(obj, **kwargs)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\sql\compiler.py", line
 793, in visit_table
    self.execute()
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
1760, in execute
    return self.connection.execute(self.buffer.getvalue())
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
844, in execute
    return Connection.executors[c](self, object, multiparams, params)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
854, in _execute_text
    self.__execute_raw(context)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
916, in __execute_raw
    self._cursor_execute(context.cursor, context.statement,
context.parameters[0], context=context)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
953, in _cursor_execute
    self._handle_dbapi_exception(e, statement, parameters, cursor)
  File "c:\python24\lib\site-packages\sqlalchemy-0.4.2p3-py2.4.egg
\sqlalchemy\engine\base.py", line
935, in _handle_dbapi_exception
    raise exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconn
ect)
sqlalchemy.exceptions.DatabaseError: (DatabaseError) internal error:
SQL Server message 2714, severi
ty 16, state 6, line 2:
There is already an object named 'visit' in the database.
DB-Lib error message 10007, severity 5:
General SQL Server error: Check messages from the SQL Server.
 '\nCREATE TABLE visit (\n\tvisit_key VARCHAR(40) NOT NULL, \n
\tcreated DATETIME NOT NULL, \n\texpir
y DATETIME, \n\tPRIMARY KEY (visit_key)\n)\n\n' {}

</Elixir>

This sucks.

Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to