Same exposed names - Worked in 2000 not 2005

  • I knew before we upgraded there were changes to queries in the Order Clause. I fixed most (got me on two) before the upgrade.

    But now this isn't working either. Here is the error:

    Msg 1013, Level 16, State 1, Line 1

    The objects "Employee_Resources.dbo.tbl_db_info" and "Business_History.dbo.tbl_db_info" in the FROM clause have the same exposed names. Use correlation names to distinguish them.

    Any ideas how one might rewrite this?

    Select

    Business_History.dbo.tbl_db_info.bAuto_Load_Tables As Business_History

    , Employee_Resources.dbo.tbl_db_info.bAuto_Load_Tables As Emp_Resr

    , Field_Requisition.dbo.tbl_db_info.bAuto_Load_Tables As Fld_Req

    , Project_Accounting.dbo.tbl_db_info.bAuto_Load_Tables As Prj_Accnting

    , Prefab.dbo.tbl_db_info.bAuto_Load_Tables As Prefab

    , Project_Management.dbo.tbl_db_Info.bAuto_Load_Tables As Prj_Mngt

    , TimeCard.dbo.Entry_tbl_db_info.bAuto_Load_Tables As TC_Entry

    , TimeCard.dbo.Review_tbl_db_info.bAuto_Load_Tables As TC_Review

    From

    Business_History.dbo.tbl_db_info

    Cross Join Employee_Resources.dbo.tbl_db_info

    Cross Join Field_Requisition.dbo.tbl_db_info

    Cross Join Project_Accounting.dbo.tbl_db_info

    Cross Join Prefab.dbo.tbl_db_info

    Cross Join Project_Management.dbo.tbl_db_Info

    Cross Join TimeCard.dbo.Entry_tbl_db_info

    Cross Join TimeCard.dbo.Review_tbl_db_info

  • Probably like this

    Select

    bh.bAuto_Load_Tables As Business_History

    , er.bAuto_Load_Tables As Emp_Resr

    , fr.tbl_db_info.bAuto_Load_Tables As Fld_Req

    , pa.bAuto_Load_Tables As Prj_Accnting

    , pf.bAuto_Load_Tables As Prefab

    , pm.bAuto_Load_Tables As Prj_Mngt

    , EntryInfo.bAuto_Load_Tables As TC_Entry

    , ReviewInfo.bAuto_Load_Tables As TC_Review

    From

    Business_History.dbo.tbl_db_info AS bh

    Cross Join Employee_Resources.dbo.tbl_db_info AS er

    Cross Join Field_Requisition.dbo.tbl_db_info AS fr

    Cross Join Project_Accounting.dbo.tbl_db_info AS pa

    Cross Join Prefab.dbo.tbl_db_info AS pf

    Cross Join Project_Management.dbo.tbl_db_Info AS pm

    Cross Join TimeCard.dbo.Entry_tbl_db_info AS EntryInfo

    Cross Join TimeCard.dbo.Review_tbl_db_info AS ReviewInfo

    It parses successfully, though I can't tell if it'll run.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you yet again.

    This upgrade is going considerably smoother with your help,

    I hope I'm able to return the favor...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply