Statement Help

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tony (anonymous_at_discussions.microsoft.com)
Date: 03/05/04


Date: Fri, 5 Mar 2004 10:56:06 -0800

I have two SQL Statements that work great using Access as the front-end, but do not work at all using Query Analyzer as my front end.
In Access the following two statements return the proper results (both statements accomplish the same thing - They both use a different technique to find unmatched records between two tables):

1)
SELECT MbrNbr
FROM dbo.TMP_MbrInfo
WHERE (NOT EXISTS
                          (SELECT Vw_MemberInfo.MbrNbr
                            FROM Vw_MemberInfo
                            WHERE Vw_MemberInfo.MbrNbr = TMP_MbrInfo.MbrNbr))
2)
SELECT dbo.TMP_MbrInfo.MbrNbr
FROM dbo.TMP_MbrInfo LEFT OUTER JOIN
                      Vw_MemberInfo ON dbo.TMP_MbrInfo.MbrNbr = Vw_MemberInfo.MbrNbr
WHERE (Vw_MemberInfo.MbrNbr IS NULL)

However, using query analyzer or enterprise manager. These do not return any results. Does anybody know why? I need something to find unmatched records. TIA.



Relevant Pages

  • Re: Statement Help
    ... What is the datatype of column MbrNbr? ... > I have two SQL Statements that work great using Access as the front-end, ... but do not work at all using Query Analyzer as my front end. ... to find unmatched records between two tables): ...
    (microsoft.public.sqlserver.programming)
  • Re: XML Outputs
    ... I am executing these SQL statements in Query Analyzer. ... Can I not create XML documents interactively using Analyzer? ... > With best regards, Alex Shirshov. ...
    (microsoft.public.sqlserver.xml)
  • Re: ADODB.Connection funkiness
    ... multiple servers. ... submit and the all the SQL statements we've typed into the form are ... the semi colon the statement executes. ... GO is a batch delimiter in Query Analyzer, outside of that it has no ...
    (microsoft.public.data.ado)
  • Re: SQL Server needs help from MS Access (or something)
    ... like is that you must save a view prior to running any SQL statements, ... unlike the query analyzer, which allows you to run code, and then just ... environment, a central repository, and works great in multi-database ...
    (comp.databases.ms-sqlserver)