Groups | Blog | Home
all groups > sql server mseq > november 2003 >

sql server mseq : => Unique Key incrementing by two and not specified 1


Rhonda Fischer
11/26/2003 8:52:40 AM
Hello,

I have a simple database of two tables, one table
listing employees and the other a list of accidents.
Whenever I add an accident the unique key is incremented
by two when the 'Identity Increment' is set to one. Where
may I look to try and solve this problem.

Thank you kindly for any suggestions that you may have.

Cheerio
Rhonda



Table Structure:
----------------

CREATE TABLE tblStaff
(
StaffID int NOT NULL PRIMARY KEY,
Surname nvarchar(50) NOT NULL,
Firstname nvarchar(50) NOT NULL,
Depot nvarchar(50),
Department nvarchar(50)
)

CREATE TABLE tblIncident
(
IncidentID int NOT NULL PRIMARY KEY,
StaffID int NOT NULL REFERENCES tblStaff([StaffID]),
IncidentNo char(10) NOT NULL,
AccDangerousOcc int,
Type char(10),
IncidentDate datetime,
Location char(15),
Injuries nvarchar(25),
Comments nvarchar(256),
ReportReceived datetime,
F2508 datetime,
BookEntry bit
)

=> Identity Seed = 1 and Identity Increment = 1 for
IncidentID
Vishal Parkar
11/30/2003 2:01:35 AM
Rhonda ,
If you are sure that identity increment is set to 1 then probably there might be a trigger
which is doing some kind of operation on the same table. You can get the trigger that is
written on the table if any, with the help of system stored procedure "sp_helptrigger". If
there is a trigger on it then check its code/text with the help of "sp_helptext" procedure

You can check identity column' s seed and increment with the help of sp_help command or
Enterprise manager (by right clicking on table and clicking on "design" option.
Ex:
sp_help <table_name>



--
-Vishal

Rhonda Fischer
12/1/2003 6:23:55 AM
Dear Vishal,

Thank you very much, that was most helpful :)

Kind Regards
Rhonda


[quoted text, click to view]
AddThis Social Bookmark Button