Sql Server int vs nvarchar comparison on performance?

前端 未结 4 1431
挽巷
挽巷 2020-12-17 21:03

For you database design/performance gurus out there.

I\'m designing a table, I have the choice of either use int or nvarchar (128) for a column, assume space is not

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-17 21:31

    The main issue with performance with this is the size of the field - an int is 4 bytes, whereas an nvarchar(128) will be 254 bytes.

    All of this needs to be manages by SQL server, so managing an int will be much faster than an nvarchar(128).

提交回复
热议问题