> I just started getting this error in one of my SQLServer 6.5 db's.
> I don't know what could be causing it. The primarykey/identity
> column is named FolderID. Why would it be trying to insert a
> duplicate if it's an autonumber?
>
> ODBC Error Code = 23000 (Integrity constraint violation)
>
> [Microsoft][ODBC SQL Server Driver][SQL Server]Violation of
> PRIMARY KEY
> constraint 'PK__Folders__FolderI__198AD3B0': Attempt to
> insert duplicate key in object 'Folders'.
>
> SQL = "INSERT INTO Folders ( ParentID, Name, Description,
> ateAdded )VALUES( 7, 'test', 'test', {ts '2000-10-04 12:27:18'} );"
There's a bug in SQL Server 6.5 which causes identity columns to get out of
sync. You can fix this by running DBCC CHECKIDENT against every table which
has an identity column. I believe this was also fixed in one of the later
SQL 6.5 service packs.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.