Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataAccessScriptSql.template
Message
De
21/04/2007 13:24:16
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
DataAccessScriptSql.template
Divers
Thread ID:
01218612
Message ID:
01218612
Vues:
55
Hi!

I was trying out the MM Business Layer Generator and found out that is does not create the correct "FROM" statement in the SP's if the Table Name has a period in it e.g. dbo.XYZ.Customer (dbo.Customer works fine) We use a period in the table name to group certain tables together kind of like a prefix but not as part of the table name. e.g. dbo.XYZ.Customer instead of dbo.XYZCustomer

In the "Select Database Items" Form when I click the "Get Data" button it shows all the correct table names in the tree view control e.g. dbo.XYZ.Customer, dbo.XYZ.Orders etc. but when I select a table like that (with a period in it) then the "Business Object Class Name" comes up as "Customer" instead of "XYZ.Customer" which is ok. I can even type in XYZ. as a prefix to the "BOC Name" but that still does not help in the SP's

When I look inside the DataAccessScriptSql.template file I see for example:
/* SELECT Stored Procedure */
IF OBJECT_ID ( '<dbo>.<SelectSprocName>', 'P' ) IS NOT NULL 
	DROP PROCEDURE [<dbo>].[<SelectSprocName>]
GO

CREATE PROCEDURE [<dbo>].[<SelectSprocName>]
<SelectParameters>
AS
	SET NOCOUNT ON;
	SELECT <SelectColumns> 
	FROM [<dbo>].[<TableName>]
	<SelectWhereClause>
GO
/* SELECT Stored Procedure END */
Here the "TableName" token is not showing the right physical table name e.g. dbo.XYZ.Customer it instead shows dbo.Customer so when the SP's are created they have the wrong table name.

Maybe is should be something like the following
/* SELECT Stored Procedure */
IF OBJECT_ID ( '<dbo>.<SelectSprocName>', 'P' ) IS NOT NULL 
	DROP PROCEDURE [<dbo>].[<SelectSprocName>]
GO

CREATE PROCEDURE [<dbo>].[<SelectSprocName>]
<SelectParameters>
AS
	SET NOCOUNT ON;
	SELECT <SelectColumns> 
	FROM [<PhysicalTableName>]
	<SelectWhereClause>
GO
/* SELECT Stored Procedure END */
Where the "PhysicalTableName" token is the same as what is shown in the tree view control when you click the "Get Data" button.


Sarosh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform