You are here: Re: Identity reused problem « MsSQL Server « IT news, forums, messages
Re: Identity reused problem

Posted by Russ Rose on 03/14/07 05:08

"Marie-Christine Bechara" <marie-christine.bechara@ifsal.com> wrote in
message news:45f57272$0$502$815e3792@news.qwest.net...
>
>
> I have a table with id an identity column.
> Can I forbid the identity column of taking the same values of deleted
> ones?

There is no foolproof way since SET IDENTITY INSERT ON will allow reuse.

You could leave the records in place, using a deleted flag column to
indicate a logical deletion.

You could use an insert trigger to intercept id's that are below the max(id)
value.

You could use stored procedures and permissions to block the usage of the
identity insert.

>
> How can I resolve this issue?
>
> *** Sent via Developersdex http://www.developersdex.com ***

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация