Click here to Skip to main content
15,887,320 members
Home / Discussions / Database
   

Database

 
GeneralRe: Parameter @Model has no default value Pin
Rob Graham20-Dec-08 13:19
Rob Graham20-Dec-08 13:19 
QuestionWhich type should i use for saving a string like this: 000000-0000? Pin
Jan Sommer19-Dec-08 8:43
Jan Sommer19-Dec-08 8:43 
AnswerRe: Which type should i use for saving a string like this: 000000-0000? Pin
Blue_Boy19-Dec-08 8:57
Blue_Boy19-Dec-08 8:57 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Jan Sommer19-Dec-08 9:01
Jan Sommer19-Dec-08 9:01 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Blue_Boy19-Dec-08 9:07
Blue_Boy19-Dec-08 9:07 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Rob Graham20-Dec-08 3:37
Rob Graham20-Dec-08 3:37 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Blue_Boy20-Dec-08 6:10
Blue_Boy20-Dec-08 6:10 
AnswerRe: Which type should i use for saving a string like this: 000000-0000? Pin
Wendelius19-Dec-08 9:03
mentorWendelius19-Dec-08 9:03 
Store it as a string. We have a very similar format for SSN and it's proven to be best in string.

If you want to search the whole SSN (using equality operator) or by describing the start of it (using LIKE '...%'), it will be efficient with string as long as you have an index on it.

If you want to search efficiently using subparts of the SSN (for example Year BETWEEN XX and YY), you can break it down to other calculated fields such as year, month etc and index them. Create a trigger which fills the calculated fields and never let the user to modify them.

Also if you can, enforce a uniqueness on the index on SSN, the search will be faster. Typically SSN should be unique but I don't know if you have exceptions and even if you do, do you encounter them in your application.

Also use triggers to verify the correct format of SSN so you won't have accidental mistakes/duplicates.

Hope this helps,

Mika

The need to optimize rises from a bad design.My articles[^]

GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Jan Sommer19-Dec-08 9:11
Jan Sommer19-Dec-08 9:11 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Wendelius19-Dec-08 9:13
mentorWendelius19-Dec-08 9:13 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Blue_Boy19-Dec-08 9:20
Blue_Boy19-Dec-08 9:20 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Rob Graham20-Dec-08 3:39
Rob Graham20-Dec-08 3:39 
GeneralRe: Which type should i use for saving a string like this: 000000-0000? Pin
Blue_Boy20-Dec-08 6:11
Blue_Boy20-Dec-08 6:11 
QuestionSSIS extraction from GBase and Universe datbases Pin
samerh19-Dec-08 3:40
samerh19-Dec-08 3:40 
AnswerRe: SSIS extraction from GBase and Universe datbases Pin
Mycroft Holmes19-Dec-08 15:35
professionalMycroft Holmes19-Dec-08 15:35 
QuestionHow To Create Non Effect Update Pin
Sam Heller19-Dec-08 0:55
Sam Heller19-Dec-08 0:55 
AnswerRe: How To Create Non Effect Update Pin
Ashfield19-Dec-08 1:47
Ashfield19-Dec-08 1:47 
GeneralNon Effect Update Pin
David Mujica19-Dec-08 4:36
David Mujica19-Dec-08 4:36 
AnswerWrap the logic in TSQL Pin
David Mujica19-Dec-08 4:29
David Mujica19-Dec-08 4:29 
GeneralOops Pin
David Mujica19-Dec-08 4:38
David Mujica19-Dec-08 4:38 
GeneralRe: Wrap the logic in TSQL Pin
Ashfield19-Dec-08 5:02
Ashfield19-Dec-08 5:02 
GeneralRe: Wrap the logic in TSQL Pin
Wendelius19-Dec-08 5:10
mentorWendelius19-Dec-08 5:10 
QuestionInstall SQL Database automatically...... [modified] Pin
grks18-Dec-08 20:52
grks18-Dec-08 20:52 
QuestionLinking tables properly with foreign keys Pin
mevatron118-Dec-08 7:28
mevatron118-Dec-08 7:28 
AnswerRe: Linking tables properly with foreign keys Pin
Wendelius18-Dec-08 8:29
mentorWendelius18-Dec-08 8:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.