Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best name for an 'item order' column?
Message
From
01/09/2008 06:32:38
 
 
To
01/09/2008 01:20:46
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01343741
Message ID:
01343751
Views:
13
>I many of my parent-child table schemas, I have a column on the child table to indicate the "order" or "sequence" that the child record is in relative to the other child records of the same parent. It is an integer field and the first record is 1, then 2, then 3 etc.
>
>I have begun "upsizing' my databases from FoxPro to Sql Server, using the Upsizing Wizard in VFP9, and have tables where this field is named 'order', and it is getting named '[order]' when if gets pushed over.
>
>I want to rename it because I do not want my column names to have brackets around them.
>
>It's obvious why SQL Server needs to do this, but I just want advice or ideas on on choosing a smart name for this column. Surely everyone has similar structures in their data schemas.
>
>P.S. I also have the same problem for my columns named 'desc', which was intended to stand for 'description', but it is getting named '[DESC]'. For that one, I am planning to rename the column to 'description'.
>
>In VFP, these column names never caused my any problems, but as I prepare my data for life in the .NET and SQL Server world, I see that this needs to be addressed.
>
>So... suggestions for this column name please.

Matt,

I've always prefixed table fields with a short table name

For a table FixedAsset, I would have fields like
fa_id
fa_desc
...
For foreign keys I prefix them twice, One for the table and one for the parent table
So, the Depreciation table would have
dep_seq
dep_fa_id   && parent key
dep_DateFrom
dep_DateTo
...
The reason I do that is for readability - I always know what table it comes from

ps: Instead of order, use Sequence or seq - see my Depreciation table
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform