The Varchar (max) column cannot be the primary key of SQL Server.
What is the maximum length of the varchar type that can be made the primary key.
This may be bad practice, but came across a situation.
900 bytes is the maximum length for a primary key, this is a bad idea, in my opinion, why don't you use a surrogate key instead?
This question has already been answered in this thread ; the short answer is that the index field cannot exceed 900 bytes. However, it is generally a bad idea to use a long VARCHAR field as an index for many reasons, such as efficiency and maintainability.
The primary key is used in all other indexes to identify rows. The presence of a potentially large megabyte value as a key makes very little sense, therefore, the general restriction on shared bytes in any key.