Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Break one table into many or leave alone?
Message
 
 
À
05/11/2009 18:34:55
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01433360
Message ID:
01433494
Vues:
30
>The ability to fill a business object from a stored procedure ( which in essence fills a datatable and then creates strongly typed properties from the currentview ) is built into Strataframe, so I is just FillmutlipleDataTables("dbo.Fill_lookup_manager") with the params indicating the BOs that will receive the data, in sequence
>
>
>So the sproc looks something like
>
>
>CREATE PROCEDURE [dbo].[Fill_lookup_manager]
>AS 
>    BEGIN
>
>
>
>-- 1 Retrieve the code data result set
>        SELECT  code.ckey,
>                code.clockey,
>                code.ccodetype,
>                code.cdescription,
>...
>                code.[timestamp]
>        FROM    code
>        ORDER BY ccodetype  
>        
>-- 2 Retrieve the agent data result set
>        SELECT  agent.ckey,
>                agent.caddinskey,
>                agent.clockey,
>                agent.cfileas,
>                agent.ccompany,
>  ...
>                agent.[timestamp]
>        FROM    agent
>        ORDER BY ccompany ;
>
>-- 3 Retrieve the association data result set
>        SELECT  association.ckey,
>                association.clockey,
>                association.ccode,
>                association.cname,
>  ...
>                association.[timestamp]
>        FROM    association
>        ORDER BY cname ;
>
>-- 4 Retrieve the broker data result set
>        SELECT  broker.ckey,
>                broker.clockey,
>                broker.cinfotokey,
>                broker.cfileas,
>                broker.csalutation,
>    ...
>                broker.[timestamp],
>                ( SELECT    cdescription
>                  FROM      code
>                  WHERE     broker.cinfotokey = code.ckey
>                ) AS cinfoto
>        FROM    broker
>        ORDER BY ccompany ;
>...
>
>

In this SP last lookup (broker) - would it be more efficient to do an inner join (subqueries usually perform worse than regular joins)?


>I have a lookup manager that creates has properties for each lookup bo and that fills them from the sproc on startup
>
>
>            '-- use sproc to fill em all 
>            Using cmd As New SqlCommand("dbo.fill_lookup_manager")

If you specified the command here, does the setting CommandText become redundant?


>                cmd.CommandType = CommandType.StoredProcedure
>                cmd.CommandText = "fill_lookup_manager"

>                BusinessLayer.FillMultipleDataTables(cmd, _
>                                                     _code, _agent, _association, _broker, _carrier, _
>                                                     _ccagent, _ccarrier, _ccassociation, _cccdiscount, _ccchaggrat, _
>                                                      _ccchazard, _ccchcomponent, _ccchdeductible, _ccchdiscount, _ccchexplvl, _
>                                                     _ccchinccov, _ccchperil, _cccomponent, _cccoverage, _cccperil, _
>                                                      _ccendfee, _ccendorsement, _ccendtodo, _ccfee, ccfinopt, _
>                                                     _ccmga, _classtype, _codetype, _finopt, _location, _
>                                                     _mga, _nextnumbers, _taxclass, _taxcoverage, _taxjuris)
>            End Using
>
>

Is BusinessLayer a static class? Do we have Static classes in VB.NET ?

Also, what are _code, _agent, etc. here - ?


>This is a framework method, of course, but well within the normal abiliites of ADO.
>
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform