[sqlalchemy] copy database from MS SQL Server database to PostgreSQL database

2010-04-14 Thread Tan Yi
So what I want to do is to reflect all the tables in an existing MS SQL Server database, and use for loop on sorted_tables list and tometadata() function to create a new PostgreSQL database. However, there are some datatype incompatibility. Got an exception about collation on MS SQL server tables.

[sqlalchemy] Re: mapper for ms sql server

2010-04-09 Thread Tan Yi
I think what desmaj said makes a good point. Actually the Source table/ mapper indeed was created by someone else, and I just used Attach database to attach the mdf file and log file to the server. But how am I going to deal with this though? should I go ahead and use SA's account and create a

[sqlalchemy] mapper for ms sql server

2010-04-08 Thread Tan Yi
Hello. Recently I have been working on this environment: linux + pyodbc + sqlalchemy 5.8 + ms sql server. In the program, I try to build a mapper from a db table to my python class, then I instatiate the class, and try to use session.add() to insert record to database. However, I need to have

[sqlalchemy] Re: sqlalchemy reflection

2010-04-01 Thread Tan Yi
Wondering if I need the creating table, or creating views priviledge to reflect tables. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to

[sqlalchemy] Re: sqlalchemy reflection

2010-04-01 Thread Tan Yi
Don't want to reask, but help me please. Can somebody tell me what kind of permission (in terms of ms sql server) do I need in order to do table reflection? Thank you! -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

[sqlalchemy] Re: sqlalchemy reflection

2010-04-01 Thread Tan Yi
After 6 hours of searching and debugging,finally figured out the permission needed for table reflection, those are: select, and connect replication for ORM to work, you need one more: Alter any schema to do add() or delete() you obviously need more permission, respectively. Those are

[sqlalchemy] sqlalchemy reflection

2010-03-31 Thread Tan Yi
quick question: for sqlalchemy+ms sql server, what kind of accessibility does it need to do table reflection? What I am trying to do is that I try to reflect a table from an existing database, and I successfully created an engine. But I got following exception: raise exc.DBAPIError.instance(None,

[sqlalchemy] Re: The correct usage of use_alt to avoid circular dependency

2010-03-26 Thread Tan Yi
Thanks for clarification. Sorry that I do not think I understand circular dependency and compsite key very well. Also can you help me to read the circular dependency error message? I mean How to find the circle from the error message of Circular Dependency. Here is the error message:

[sqlalchemy] The correct usage of use_alt to avoid circular dependency

2010-03-25 Thread Tan Yi
I want to create a table, say: employee_table = Table( 'employee',metadata, Column('id',Integer,primary_key=True), Column('name',String(255)) ) staffGroup_Table = Table( 'role',metadata,

[sqlalchemy] Re: ms sql server schema.sequence

2010-03-18 Thread Tan Yi
Thanks a lot, this is the information I am looking for! -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to

[sqlalchemy] ms sql server schema.sequence

2010-03-16 Thread Tan Yi
Whenever I try to use schema.sequence() function on ms sql server, the return serial number (after flush()) is not started from 0, instead, it is started from a random number or something. wondering how to work aroud this issue. try to specify start = 0 in sequence function, but no luck -- You

[sqlalchemy] Re: ms sql server schema.sequence

2010-03-16 Thread Tan Yi
I mean, I tried to debug a program, using session add() to insert new records to database after I deleted all the old records from a table. I used the schema.sequence() to build up a mapper Can anyone help? On 3月16日, 下午2时05分, Tan Yi tonytan198...@gmail.com wrote: Whenever I try to use

[sqlalchemy] pymssql issues with nvarchar ntext

2010-03-15 Thread Tan Yi
pymssql does not suport reading in nvarchar and ntext since it is encoded as unicode in sqlserver. is any API could convert the query result into Unicode? Tried 'convert_unicode' argument in create_engine, and it seems not working. Thank you! --Tony -- You received this message