How Can I add IDENTITY increment

Issue #354 closed
lazy mule created an issue

here is my class configration , i am using mssql server (delphi/unidac)

I can't see IDENTITY (1,1) in table

how can i do it

  [Entity]
  [Table('TestTablo', 'dbo')]
  TTestTablo = class(TObject)
  private
    fId: Integer;
    Fkodu: string;
    FADI: string;
    FSOYADI: string;
  public
  public
    [Column('ID', [cpPrimaryKey, cpRequired, cpNotNull, cpDontInsert,
      cpUnique])][AutoGenerated]property Id: Integer read fId write fId;
    [Column]property Kodu: string read Fkodu write Fkodu;
    [Column]property ADI: string read FADI write FADI;
    [Column]property SOYADI: string read FSOYADI write FSOYADI;

  end;

The table I want to create

CREATE TABLE [dbo].[TestTablo](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [Kodu] [nvarchar](50) NULL,
    [ADI] [nvarchar](50) NULL,
    [SOYADI] [nvarchar](50) NULL,
 CONSTRAINT [PK__TestTabl__3214EC2771AE34EA] PRIMARY KEY CLUSTERED 
(
    [ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

Thanks

Comments (3)

  1. lazy mule reporter

    Yes, you are right Thank you for your help I wish there were some more database samples especially ManyToOne, OneToMany

  2. Log in to comment