Does It Worth Switching A Primary Key From The Type Nvarchar To The Type Int?
On our SQL SERVER 2008 R2 database we have an COUNTRIES referential table that contains countries. The PRIMARY KEY is a nvarchar column: create table COUNTRIES( COUNTRY_ID nvarc
Solution 1:
I would personally recommend changing COUNTRY_ID from nvarchar(50) to an INT. An int uses 4bytes of data and is usually quicker to JOIN than VARCHAR.
You can also check to see if the space used is reduced by using the stored procedure sp_spaceused
EXEC sp_spaceused 'TableName'
Post a Comment for "Does It Worth Switching A Primary Key From The Type Nvarchar To The Type Int?"