Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250

    Question Unanswered: Issue while querying table as Domain user

    I see a strange problem while querying a table. This query is in a stored proc,

    query as Domain\user1

    Select min(value) from table1 where condition1 --- returns NULL

    query as Domain\user2

    Select min(value) from table1 where condition1 --- returns the min value from table based on conditions

    Any hints on what is the possible reason for this?

    Thanks,
    Baburaj
    Cheers....

    baburajv

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Is your "condition 1" stochastic? Without knowing your schema and query I'm guessing a lot.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    This is the query
    Select min(g.group_id)
    FROM user_groups g
    JOIN user_roles x
    ON g.group_id = x.group_id
    WHERE g.group_name = @group_name
    AND x.role_id = @role_id

    Both the instances ( While querying as domain\User1 and Domain\user2, the variables, @group_name and @role_id are the same, say values 'group1' and 10
    Cheers....

    baburajv

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Just for giggles:
    1. nclude the @group_name and @role_id variables in the SELECT list.
    2. Use SSMS (SQL Server Management Studio) to run the modified query as both domain\User1 and as domain\User2 and compare the results.
    3. Execute the modified query however you execute it now (probably via code)
    4. Inspect all three returned values (probably using a debugger)

    What changes?

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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