From: Chris W. <cwi...@op...> - 2002-09-28 01:10:04
|
On Fri, 2002-09-27 at 19:15, Gavin King wrote: > Thats what happens when you write emails at 3 am. I meant to express my > interest in the fact that MS SQL can generate values that are unique, not > for the whole table, but only for other rows with the same values in the > other primary key fields. I never knew something like that existed... IDENTITY fields in MS SQL (and Sybase, for that matter) are very simple: there can be only one IDENTITY field per table, and every INSERT is guaranteed to generate a unique value for that field. Beyond that, you can use them however you like -- they *can* (and frequently are) a single primary key field, but that's not a requirement. Whether it's a good design to have an IDENTITY field as part of a composite key is another discussion... :-) Chris |