March 14, 2012 at 6:36 am
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
March 14, 2012 at 6:46 am
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
March 14, 2012 at 6:59 am
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