Solved

Union Joins

Posted on 2012-04-04
11
242 Views
Last Modified: 2012-04-17
I have three unions [1011], [1011], [1112].

With the unions you need to have the same numhber of rows in each select, which is fine.

The additional select in each union is      
,[Primary Diagnosis Code],LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC

But my question is I only want to do the joins on the last union. But this causes a problem because Msg 4104, Level 16, State 1, Line 119
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
Msg 4104, Level 16, State 1, Line 279
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.

Which means the join need to be in each union.



SELECT

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]


           
FROM  [0910]


      UNION ALL

     
SELECT  

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]

     
FROM [1011]

      UNION ALL

SELECT

      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]
 
 
     
FROM      [1112]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


GO
0
Comment
Question by:aneilg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 6

Expert Comment

by:ingriT
ID: 37805012
Try using the UNION keyword instead of the UNION ALL keyword.
0
 
LVL 15

Accepted Solution

by:
gplana earned 325 total points
ID: 37805035
ingriT: UNION eliminates duplicates and UNION ALL don't. So I don't think the solution is to change UNION ALL by UNIONs.

aneilg: All SELECTs should have the same number of columns, and the same datatype on every column, but every select can have a different number of rows, no problem on this.

I'm not understanding the problem: it looks like ICD_PRIM_DIAG.ICD104NM field is on one of the join tables, so if you want this field on a select you need to join to this table. If you don't want this column on a select, just replace it by a value that matches the datatype of this field. For example, if this field is a text based field, you can do something like this:

SELECT

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]


           
FROM  [0910]


      UNION ALL

     
SELECT  

     
      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,'' AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]

     
FROM [1011]

      UNION ALL

SELECT

      [Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,'' AS PRIMARY_DIAGNOSIS_DESC
     
     
      ,[Secondary Diagnosis Code 1]
      ,[Secondary Diagnosis Code 2]
      ,[Secondary Diagnosis Code 3]
      ,[Secondary Diagnosis Code 4]
 
 
     
FROM      [1112]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


GO

Open in new window


Hope it helps
0
 

Author Comment

by:aneilg
ID: 37805264
this is an example of the select working.

my question is, is it possible not to have the joins in each union, only having the join on [1112]. but the problem is

Msg 4104, Level 16, State 1, Line 119
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
ect.

the query as it stands need the joins in each union. is it possible to only have the join on
the last query

SELECT

      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

            
FROM  [0910]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]

      UNION

      
SELECT  

     
      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

      
      
FROM [1011]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


      UNION

SELECT



      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC

      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

      
FROM      [1112]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 15

Expert Comment

by:gplana
ID: 37805484
Yes, just try to remove joins now, as I have replaced the field by an empty string on the select.
0
 

Author Comment

by:aneilg
ID: 37805497
ok i'll give it a go.

i was told this approcah is possible.
Select fieldNames from (

10/11 query

Union all

11/12 query

) as subQuery
Then do all the joins here
0
 
LVL 15

Expert Comment

by:gplana
ID: 37805561
Yes, this is also possible, but isn't it better the solution I give ?

Or maybe I misunderstood the goal ?
0
 

Author Comment

by:aneilg
ID: 37805578
yeah but he is Adamant I do it his way.


but if i do

SELECT * FROM (

SELECT

      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

           
FROM  [0910]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]

      UNION

     
SELECT  

     
      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC
     
      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

     
     
FROM [1011]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
            --      ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
            --      ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
            --      ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
            --      ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

            --      LEFT OUTER JOIN
            --[LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
            --      ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


      UNION

SELECT



      ,[Primary Diagnosis Code]
      ,LEFT([Primary Diagnosis Code],5) AS PRIMARY_DIAGNOSIS_ICD10
        ,ICD_PRIM_DIAG.ICD104NM AS PRIMARY_DIAGNOSIS_DESC

      ,[Secondary Diagnosis Code 1]
      ,LEFT([Secondary Diagnosis Code 1],5) AS [1ST_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC1_DIAG.ICD104NM AS SEC_DIAG1ST_DESC
     
      ,[Secondary Diagnosis Code 2]
      ,LEFT([Secondary Diagnosis Code 2],5) AS [2ND_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC2_DIAG.ICD104NM AS SEC_DIAG2ND_DESC
     
      ,[Secondary Diagnosis Code 3]
      ,left([Secondary Diagnosis Code 3],5) AS [3RD_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC3_DIAG.ICD104NM AS SEC_DIAG3RD_DESC
     
      ,[Secondary Diagnosis Code 4]
      ,left([Secondary Diagnosis Code 4],5) AS [4TH_SEC_DIAGNOSIS_ICD10]
        ,ICD_SEC4_DIAG.ICD104NM AS SEC_DIAG4TH_DESC
     

     
FROM      [1112]

) as g


                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_PRIM_DIAG
                  ON ICD_PRIM_DIAG.ICD104CD = LEFT([Primary Diagnosis Code],4)

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC1_DIAG
                  ON ICD_SEC1_DIAG.ICD104CD = [Secondary Diagnosis Code 1]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC2_DIAG
                  ON ICD_SEC2_DIAG.ICD104CD = [Secondary Diagnosis Code 2]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC3_DIAG
                  ON ICD_SEC3_DIAG.ICD104CD = [Secondary Diagnosis Code 3]

                  LEFT OUTER JOIN
            [LookUp].[dbo].[tbl_ICD10] AS ICD_SEC4_DIAG
                  ON ICD_SEC4_DIAG.ICD104CD = [Secondary Diagnosis Code 4]


i get Msg 4104, Level 16, State 1, Line 121
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
0
 
LVL 15

Expert Comment

by:gplana
ID: 37805600
Ok, in this case try the other approach:

SELECT .... FROM (
                 SELECT ... (without joins)
                 UNION ALL
                 SELECT ... (without joins)
                 UNION ALL
                 SELECT ... (without joins)
) and make the joins here
0
 

Author Comment

by:aneilg
ID: 37805652
thanks for your help,

i've done

SELECT * FROM (

) as g

joins

but get Msg 4104, Level 16, State 1, Line 121
The multi-part identifier "ICD_PRIM_DIAG.ICD104NM" could not be bound.
Msg 4104, Level 16, State 1, Line 125

is this appracah possible.
0
 
LVL 15

Expert Comment

by:gplana
ID: 37805834
This is because you don't have the ICD_PRIM_DIAG table on your SELECT or because field ICD104NM is not a valid field on ICD_PRIM_DIAG table
0
 

Author Closing Comment

by:aneilg
ID: 37855755
thanks.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question