title: SQL Server view not working after edit in Management Studio
body: <p>I had a view that worked, I edited it in SQL Server Mgmt Studio, it didn't work, I took out the changes and saved it down, it still doesn't work despite reverting it back to its original state.</p>
  
  <p>I'm getting the error </p>
  
  <blockquote>
    <p>Joined tables cannot be specified in a query containing outer join
    operators. View or function 'adept_invoiced' contains joined tables.</p>
  </blockquote>
  
  <p>I've googled around and come up with a possible join syntax problem due to the view being written in 2001 and me trying to edit it (for the first time) in Management Studio.</p>
  
  <p>The view ran perfectly for years until I edited it this morning.</p>
  
  <p>This is the From/Where section....</p>
  
  <pre><code>FROM   dbo.SYS_COMP_ADDRESS
         CROSS JOIN dbo.SL_ACCOUNTS
         INNER JOIN dbo.SL_TRANSACTIONS
                    INNER JOIN dbo.ORD_HEADER
                      ON dbo.SL_TRANSACTIONS.ST_ORDER_NUMBER =
                         dbo.ORD_HEADER.OH_ORDER_NUMBER
                    INNER JOIN dbo.SL_PL_NL_DETAIL
                               LEFT OUTER JOIN dbo.STK_STOCK
                                 ON dbo.SL_PL_NL_DETAIL.DET_STOCK_CODE =
                                    dbo.STK_STOCK.STKCODE
                               INNER JOIN dbo.ORD_DETAIL
                                 ON dbo.SL_PL_NL_DETAIL.DET_ORDER_LINK =
                                    dbo.ORD_DETAIL.OD_PRIMARY
                               LEFT OUTER JOIN dbo.STK_STOCK3
                                 ON dbo.SL_PL_NL_DETAIL.DET_STOCK_CODE =
                                    dbo.STK_STOCK3.STKCODE3
                               LEFT OUTER JOIN dbo.STK_STOCK_2
                                 ON dbo.SL_PL_NL_DETAIL.DET_STOCK_CODE =
                                    dbo.STK_STOCK_2.STKCODE2
                               LEFT OUTER JOIN dbo.PRC_PRICE_RECS2
                                 ON dbo.SL_PL_NL_DETAIL.DET_PRICE_CODE =
                                    dbo.PRC_PRICE_RECS2.PRCODE2
                      ON dbo.SL_TRANSACTIONS.ST_HEADER_KEY =
                         dbo.SL_PL_NL_DETAIL.DET_HEADER_KEY
           ON dbo.SL_ACCOUNTS.CUCODE = dbo.SL_TRANSACTIONS.ST_COPYCUST
         INNER JOIN dbo.SL_ACCOUNTS2
           ON dbo.SL_ACCOUNTS.CUCODE = dbo.SL_ACCOUNTS2.CUCODE2
  WHERE  ( dbo.SL_TRANSACTIONS.ST_TRANTYPE IN ( 'INV', 'CRN' ) )
         AND ( dbo.SL_TRANSACTIONS.ST_BATCH_FLAG &lt;&gt; 1 )
         AND ( dbo.SL_ACCOUNTS.CUCODE &lt;&gt; '1023134' )
         AND ( dbo.SL_ACCOUNTS.CUCODE &lt;&gt; '1023265' )
         AND ( dbo.SL_ACCOUNTS.CUSORT NOT LIKE '%other income%' )
         AND ( dbo.SL_ACCOUNTS.CUSORT NOT LIKE '%supplier%' )  
  </code></pre>
  
  <p>I'm not sure where it might be failing, or how to fix it!</p>
  
  <p>Any help would be greatly appreciated.</p>