Indy Homepage

Indy.Data 

Web Designer Wanted!

   Download   |  
    Indy Project  »  Indy.Data  »  Databases
 

 

License 

Website problems?
Contact webmaster.
 

Website


Our builds are

VCS by

 

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
[Image] [Image]

 

Copyright © 1993 - 2008
Chad Z. Hower (Kudzu)
and the Indy Pit Crew.