Since I have the same tables in multiple databases, what I did was put the ALTER TABLE statements to create the primary key constraint into a stored procedure. Your way is better because it keeps the primary key creation with the table creation.

I did an online chat with a "help person" at Microsoft last night, explaining the situation, and asking if they could tell me why the primary key constraint creation was hit or miss with my stored procedure. They didn't know why, especially after I showed them how I copied the text verbatim from the Books Online to use as a template.