Saturday, February 25, 2012

Database design question

I am brand new to both programming and databases and am trying to design a database for my job as a paramedic.

I am using Visual Studio 2005 , and MSSQL . I am trying to create a log for all of our ambulance calls.

My question comes in when I try to design a field that holds our case number , which is formatted as 07-0001. Basically, the year , then four digits for the remainder of the case number .

Any help on how to accomplish this would be SO appreciated !!!I would use a varchar for this.

presumably you want to preserve the minus sign and the leading zero - this rules out any numeric storage types such as int.|||Thanks ! So, does this mean I can't use that field as an ID for my database ? Also, how would I go about the formatting I would need ?

Sorry to be such a novice, but I do SO appreciate the help !|||the reply depends on many other questions. will the database generate the next call-number or it is a user input/front-end generated number? is the number editable? will the number recycle missing numbers specially the last deleted ones?
there are quite a few options. it could be saved in 2 separate fileds and formatted properly during display, it could be a formula field, it could be a plain varchar field with validations etc. etc...

No comments:

Post a Comment