Home > Uncategorized > Main tables in AM – amModel and amNature

Main tables in AM – amModel and amNature

The Models table (amModel) and the Natures table (amNature).

These two tables are prerequisites for creating items in your portfolio.

Portfolio items are based on a model, which in turn is based on a nature.
The Models table enables you to organize your portfolio

— =======================================================
— amNature (defines overflow tables) and amModel
— link: lNatureId
— amModel has lNatureId (FK) and also lBrandId (FK)
— amModel is also hierarchical (lParentId and sLvl, highest level is 0)
— amModel: defines the hierarchy of "models"
— =======================================================

— highest level model
select    a.lModelId
,        a.lBrandId
,        a.lNatureId
,        c.OverflowTbl
,        a.Name
,        a.FullName
,        a.dtLastModif
,        b.memComment
,        b.TableName
from    EAMDev.dbo.amModel a
left join
        EAMDev.dbo.amComment b
on        a.lCommentId = b.lCommentId
left join
        EAMDev.dbo.amNature c
on        a.lNatureId = c.lNatureId       
where    a.sLvl = 0
and        a.lModelId > 0
order by
        a.FullName

— what’s the hierarchy of "Computer Equipment"
select    a.lModelId
,        a.lBrandId
,        d.Name
,        d.FullName
,        a.lNatureId
,        c.OverflowTbl
,        a.Name
,        a.FullName
,        a.dtLastModif
,        b.memComment
,        b.TableName
from    EAMDev.dbo.amModel a
left join
        EAMDev.dbo.amComment b
on        a.lCommentId = b.lCommentId
left join
        EAMDev.dbo.amNature c
on        a.lNatureId = c.lNatureId   
left join
        EAMDev.dbo.amBrand d
on        a.lBrandId = d.lBrandId   
where    a.FullName like ‘%Computer Equipment%’
order by
        d.Name, a.FullName

image

image

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: