[dba-SQLServer] PK/ANPK Debate

Francisco Tapia fhtapia at gmail.com
Tue Mar 11 14:23:48 CDT 2014


On Tue, Mar 11, 2014 at 9:17 AM, Mark Breen <marklbreen at gmail.com> wrote:

> Just on question, not sure what you mean when you said
>
> >As for anpk, why should coding up a lookup save me time as a programmer in
> my queries?
>

Hey Mark, sorry, I was not very clear there, I combined my response which
is what Arthur was initially stating, was, why not save the developer some
query brain power.  I stand by my response, I can re-architect a solution
so I code it as fast as possible taking every conceivable shortcut
especially when you consider how fast computers are today, most of my bad
coding practices perhaps would not surface initially, though it wouldn't
scale once you began to roll it out.

the ANPK solution as you setup is one way to create a simple shortcut that
does not impact the system negatively.  The important thing is to stay
consistent. in the manner that SAP builds their lookup tables they like to
group things up, so all damage code related lookups are grouped together.
But which ever way you do it your actual FKID is an autonumber and that
makes it nice and easy to update if you should have to for some reason down
the line.


-Francisco <http://twitter.com/seecoolguy>


More information about the dba-SQLServer mailing list