FarligOpptreden
Executive Member
Bravo! Gnome to the rescue!
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Err, that is usually when you add a new field that it's -1, -2, etc. when you save the DBMS will assign a value. So in other words, you add a new field and it's ID is -1, you add another it's -2, then you save and it is COMMITTED, at that point is will no longer be negative, else post code and I'll help you.
Are the negative ID values being saved to the table afterwards? Or do the entries only have a negative ID while the "batch" hasn't been committed to the DB yet?
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.UInfo
DROP CONSTRAINT PK_UInfo
GO
COMMIT
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE dbo.UBill ADD CONSTRAINT
PK_UBill PRIMARY KEY CLUSTERED
(
ID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
COMMIT