First way is right way, because it guarantee data integrity!
Read this:
IDENTITY()[
^] to get explanation ;)
Second way is pseudo-identity and does
NOT guarantee unical numbers and data integrity. Why?
Imagine this situation: Your
MAX(PK)=500
. You have added 1 record, so your "identity" is equal:
MAX+1=501
. Delete last record and add it again. What number ("identity") you'll get? What happend if in other table exists foreign key with
501
? You'll lose data integrity.