/* 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.
/* 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.