-
best way to compare last row with new insert
Hi !
for MS SQL 2000
I need an UsersHistory Table where i cannot INSERT 2 rows one after the other with the same user.name
I can get
Bob
David
Bob
but not
Bob
Bob
David
something like an INDEX on rows
or
INSERT INTO UsersHistory (name) VALUES ('bob') IF MAX(name) <> 'bob' ?
what is the best way to do it ?
thank you
Last edited by anselme; 01-21-2007 at 01:59 AM.
-
Does the table have datetime or serial number column? If not, how do you know which row is last row?
-
the last row is the last id (autoincrement) there is also a datetime column = getDate()
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|