Primary Key Auto-Increment

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Primary Key Auto-Increment

André VICENTE
I'm using SQL Server 2008.
To insert a tuple in a table that has a Primary Key that is Auto-Increment I have to use
only InsertIdentityOperation.INSERT only???

If I use only this method, the SQL Server throws a exception saying that the table
is a Identity and it was set Off.

How I can solve this problem?

André

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Primary Key Auto-Increment

André VICENTE
Anybody implement a IdentifyFilter to provide a personalized Identity Filter?

IDatabaseConnection connection = new DatabaseConnection(jdbcConnection);
    connection.getConfig().setProperty(
        "http://www.dbunit.org/properties/mssql/identityColumnFilter",
        new MyIndentityFilter());

How can I set the Identitity Property if it isn´t present in connection.getConfig()???
Reply | Threaded
Open this post in threaded view
|

Re: Primary Key Auto-Increment

gunipati81
In reply to this post by André VICENTE
Even i am facing the same issue. Did you find any answer to this problem ?