Re: Different results between stored procedure and query analyzer
From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 07/19/04
- Next message: Avdhut Kavdikar: "Clustered Index - Parameterized queries"
- Previous message: Brian Henry: "Re: Case sensative strings in SQL Server / ADO.NET"
- In reply to: Scott McNair: "Different results between stored procedure and query analyzer"
- Next in thread: Scott McNair: "Re: Different results between stored procedure and query analyzer"
- Reply: Scott McNair: "Re: Different results between stored procedure and query analyzer"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 19 Jul 2004 11:28:25 -0400
Scott,
Can you please post DDL for the tables (in the form of CREATE TABLE
statements), some sample data (in the form of INSERT statements), the full
code of the sproc, exactly the syntax you're using to call the sproc, and
exactly what you're running from QA (including DECLARE @loginname, etc)?
This way, we can either verify your problem and help you fix it more easily,
or in the process of preparing all of this you might figure out where you
are going wrong.
"Scott McNair" <scott.mcnair@sfmco.takethispartout.com> wrote in message
news:Xns952B69696AEE3sfmco@207.46.248.16...
> I'm running into a strange behavior on Query Analyzer. I've got the
> same line of code in a stored procedure and in QA:
>
> SELECT count(*) as Unread FROM tbl_productimages where imagetracking not
> in (select imagetracking from tbl_tracking where loginname = @loginname)
> and disabled is null
>
> However when I run it with the SP, I get "55" as a result (which is
> correct), but when I run it in QA, I get "0" as a result.
>
> Both instances are running as SA, and I'm running it in the same
> database. If I try running individual portions of the line, I get
> results (i.e., "select imagetracking from tbl_tracking where loginname =
> @loginname" returns proper results and "SELECT count(*) as Unread FROM
> tbl_productimages where disabled is null" returns proper results). Also
> I changed "not in" to "in" and it worked, so it looks like the problem
> is with the word "not".
>
> I've had two other co-workers look over the line, and they've played
> with the syntax until they were blue in the face with no better results.
>
> I really think I'm running into some sort of QA bug, but I'd like to get
> some feedback from the experts before I say that for sure.
>
> Regards,
> Scott
>
> PS imagetracking is a uniqueidentifier, if that matters at all.
- Next message: Avdhut Kavdikar: "Clustered Index - Parameterized queries"
- Previous message: Brian Henry: "Re: Case sensative strings in SQL Server / ADO.NET"
- In reply to: Scott McNair: "Different results between stored procedure and query analyzer"
- Next in thread: Scott McNair: "Re: Different results between stored procedure and query analyzer"
- Reply: Scott McNair: "Re: Different results between stored procedure and query analyzer"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|