home

about

license

support

K/Base

Indy
HomeContactsSite Map


SQL Server

Sequences

Indy.Data optionally uses sequnences. If you use the sequence support (The test suites do) you will need to add a table and a stored procedure that Indy.Data will use to implement the sequence functionality.

SQL server does not support sequences. If you choose to use the sequence functionality of Indy.Data instead of identity/autoinc columns you will need to add the following to your database.

CREATE TABLE [dbo].[Generator] (
 [GeneratorID] [int] IDENTITY (1, 1) NOT NULL ,
 [GeneratorName] [varchar] (80) NOT NULL ,
 [GeneratorValue] [int] NOT NULL
) ON [PRIMARY]

CREATE PROCEDURE gen_id
      @Name varchar(80),
      @Increment INT,
      @Value INT OUTPUT
AS
      set @Value = -1
             
      UPDATE Generator
      SET @Value = GeneratorValue = GeneratorValue + @Increment
      WHERE  GeneratorName = @Name

      RETURN @Value

For each sequence insert a new row into the Generator table.

 


Corporate Sponsors

Atozed







home

about

license

support

K/Base

site map

links

Copyright © 1993 - 2008 Chad Z. Hower (Kudzu) and the Indy Pit Crew.          Website design by RuInternet.ru