Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    22

    Unanswered: Invalid column name 'Expr1010' in SQLQuery

    Code:
    SELECT WMP.[PlanName] 'AA'
    		FROM [CUSCONFIG].WorkMgmtPlan WMP (NOLOCK)
     		INNER JOIN [CUSCONFIG].WorkMgmtPlanLineItems WPL (NOLOCK)-- GET WORK REQUESTS
     		ON WMP.PlanID = WPL.WorkMgmtPlanID AND WMP.[IsActive] = 1 AND WPL.[IsActive] = 1 AND [Type] = 'R'
     		INNER JOIN [CUSCONFIG].pcworktypes PC (NOLOCK)		-- GET WORK TYPES
    		ON WPL.[PCWorkTypeID] = PC.[PCWorkTypeID] and PC.[isactive] = 1
    		INNER JOIN [CUSCONFIG].PCProcessPackages  pp (NOLOCK)
    		on PC.[pcprocesspackageid] = pp.[ProcessPackageId]
    		INNER JOIN [CUSDASHBOARD].MasLevelValues MLVA (NOLOCK) -- CHECK FOR PROJECTS
     		ON MLVA.[SourceSystemID] = CONVERT(varchar,WMP.ProliteProjectID)

    ERROR:

    Msg 8180, Level 16, State 1, Line 1
    Statement(s) could not be prepared.
    Msg 207, Level 16, State 1, Line 1
    Invalid column name 'Expr1010'.
    Msg 207, Level 16, State 1, Line 1
    Invalid column name 'Col1051'.
    Msg 207, Level 16, State 1, Line 1
    Invalid column name 'Col1050'.


    SHOWPLAN DATA:

    Code:
    |--Merge Join(Inner Join, MANY-TO-MANY MERGE:([Expr1010])=([MLVA].[SourceSystemID]), RESIDUAL:([c20cddev ].[CUSDASHBOARD].[MasLevelValues].[SourceSystemID] as [MLVA].[SourceSystemID]=CONVERT_IMPLICIT(nvarchar(30),CONVERT(varchar(30),[CTSINTBMVCTRTD1].[Cognizant20].[Dbo].[WorkMgmtPlan].[ProliteProjectID] as [WMP].[ProliteProjectID],0),0)))
           |--Compute Scalar(DEFINE:([CTSINTBMVCTRTD1].[Cognizant20].[Dbo].[WorkMgmtPlan].[PlanName]=[CTSINTBMVCTRTD1].[Cognizant20].[Dbo].[WorkMgmtPlan].[PlanName] as [WMP].[PlanName], [CTSINTBMVCTRTD1].[Cognizant20].[Dbo].[WorkMgmtPlan].[ProliteProjectID]=[CTSINTBMVCTRTD1].[Cognizant20].[Dbo].[WorkMgmtPlan].[ProliteProjectID] as [WMP].[ProliteProjectID], [Expr1010]=[Expr1010]))
           |    |--Remote Query(SOURCE:(CTSINTBMVCTRTD1), QUERY:(SELECT "Col1050","Col1051","Expr1010"  ORDER BY "Expr1010" ASC))
           |--Sort(ORDER BY:([MLVA].[SourceSystemID] ASC))
                |--Index Scan(OBJECT:([c20cddev ].[CUSDASHBOARD].[MasLevelValues].[IX_CUSDASHBOARD_MASLEVELVALUES] AS [MLVA]))

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Are all of the databases referenced in this query local, or are we dealing with linked servers here?
    Ken

    Maverick Software Design

    (847) 864-3600 x2

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Looks like there are underlying views there. Is it me of at least one of the views is also using TOP...ORDER BY?
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •