Identity constraint was changed...

Posts   
 
    
morten71
User
Posts: 80
Joined: 13-Jan-2009
# Posted on: 25-Nov-2015 23:34:50   

I'm using v4.2 (Nov 20th 2015). Sql 2014.

On the "Relational Model Data" I have the text (changes pending). The generated ddl sql update script has 4 similar table ddl snippets for 4 different tables:


ALTER TABLE [dbo].[Language] 
    -- Identity constraint was changed on field 'LanguageId'. However SQL Server doesn't allow changing this in SQL. 
    -- This means that you have to do this manually by creating a new temporary column, copy over all data and then remove 
    -- the column (cumbersome, due to FK constraints). Another, probably less cumbersome way, is to do this through SSMS, which 
    -- does the handling for you. Example of how to do it manually:
    -- http://stackoverflow.com/questions/702745/sql-server-how-to-drop-identity-from-a-column
    -- Discussion about this issue on MS' forums:
    -- http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/04d69ee6-d4f5-4f8f-a115-d89f7bcbc032/
    ALTER COLUMN [LanguageId] [int] IDENTITY (1,1) NOT NULL
GO

When I first generated code all 4 tables had the identity property set to Yes. However, since then the identity property has been changed to No (would like to keep it this way).

I have tried to remove and re-add the tables, which does not change the state.

Are the changed settings not picked up by the designer?

/Morten

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 26-Nov-2015 05:29:57   

However, since then the identity property has been changed to No (would like to keep it this way).

Is this done on the Database or in the Designer?

morten71
User
Posts: 80
Joined: 13-Jan-2009
# Posted on: 26-Nov-2015 07:56:13   

Walaa wrote:

However, since then the identity property has been changed to No (would like to keep it this way).

Is this done on the Database or in the Designer?

the change was done on the database

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39590
Joined: 17-Aug-2003
# Posted on: 26-Nov-2015 13:50:29   

You have it changed in the DB and in the designer (as it suggested a ddl script needed to be created) ? You've now exported the script, if you refresh the catalog, it should remove the sequences from the table mappings.

Or perhaps I'm confused what the state of the model is (do the field mappings contain a sequence?, are the fields in catalog explorer marked as 'identity' ?)

Frans Bouma | Lead developer LLBLGen Pro