views:

65

answers:

1

Can anyone of you please tell me which is the best data type for a surrogate key (number or varchar2)? I have read that surrogate key works best with the number type. But is the performance seriously have major impact with the data types. And is it database dependent too?

reply would be much appreciated!

+2  A: 

A numeric datatype is going to be faster than a varchar in any database that I can imagine -- consider the act of comparing -- but you have to do whatever fits your situation. If varchar makes sense, go for it. If either fits equally well for you, stick with a numeric.

Jay