Using symbols in primary key

Hi All,

I started to working on a project. I dont have a lot experiences except basic information. I just want to ask can I use symbols in primary key column like 2015/1234 etc. for file numbers. These are file numbers and must be unique so i decided to make them primary keys but im not sure that i can use symbols. thanks from now.

July 25th, 2015 4:39am

The primary key column contents don't matter as long as it unique and not null and under the max key size (900 bytes are less).  A natural "file number" key can be used as primary key within those restrictions.  It is the underlying data type that will determine the domain of data that can be stored.

If you choose to introduce a surrogate primary key anyway (e.g. identity column), it would be best to create a unique constraint on the file number to ensure uniqueness.

Free Windows Admin Tool Kit Click here and download it now
July 25th, 2015 7:42am

We think you need to improve the concept of Primary key

What is a key, and why is one of them a primary key?

August 3rd, 2015 12:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics