-3

I want to use SQL statements on insert to insert the new / next identifier value for my Primary Unique Index while being able to support joins with PK and FK relationships> What is the simplest solution? Data type/length recommendation? The data is reference, operational and technical metadata relatively lower volumes to transactional data.

1 Answers1

0

Without knowing your data needs, I would use an INT for the primary key as you state this is relatively lower volumes of transactional data. INT supports -2,147,483,648 to 2,147,483,647. As I would use an auto incrementing integer beginning at 1 as the primary key, if you plan to have more than 2 billion rows then use a big int which supports up to 9,223,372,036,854,775,807. This will automatically populate your primary key.

Andrew O'Brien
  • 1,793
  • 1
  • 12
  • 24
  • Thank You. I decided to go with an int identity vs a guid or some other value. I also realized my insert into did not need to declare the identity field – user7347640 Jun 29 '17 at 21:16