🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-sqlserver
Article #62

Re: Access counter type equivalent in SQL-Server 6.0

#62
From: Ren� Iffarth
Date: Tue, 02 Apr 1996 00:00
24 lines
1500 bytes
John A. Simpson wrote:
> 
> I need to find out if there is some sort of equivalent to the Counter type in
> Access for SQL Server 6.0.  I already know about IDENTITY and TRIGGERs,
> however, both of these methods increment the counter field after the data is
> committed.  Our project is using the counter field as a foreign key so I need
> this field to be incremented before I commit the data.
> 
> Can anyone help me???
> 
> Thanks...
> 
> John A. Simpson
> Analysts International Corp.
> jsimpson@i1.net

You should create an insert trigger, that is fetching the next value for 
the counter ( MAX(id_column)+1,... or so ) and set this value to your 
id_column in the table.

regards
Ren� Iffarth
ri@daa.de
germany
Technical Details
Message-ID: <316166C0.4F85@daa.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4jp2qv$puj@news1.i1.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 104de1,c59097bc5364613e
X-Google-Attributes: gid104de1,public
X-Google-Thread: 11acf5,c59097bc5364613e
X-Google-Attributes: gid11acf5,public
X-Google-Thread: 11355a,c59097bc5364613e
X-Google-Attributes: gid11355a,public
From: Ren� Iffarth <riffarth@daa.de>
Subject: Re: Access counter type equivalent in SQL-Server 6.0
Date: 1996/04/02
Message-ID: <316166C0.4F85@daa.de>
X-Deja-AN: 145446826
references: <4jp2qv$puj@news1.i1.net>
to: "John A. Simpson" <jsimpson@i1.net>
content-type: text/plain; charset=iso-8859-1
organization: daa GmbH Systemhaus
mime-version: 1.0
newsgroups: comp.databases.ms-sqlserver,bit.databases.mssql-1,bit.listserv.sqlinfo
x-mailer: Mozilla 2.0 (Win95; I)