Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    KY
    Posts
    146

    Unanswered: Need help on this complex query

    Result of the select from dbUsers is

    db_name User Group
    DB1 U1 db_datareader
    DB1 U1 db_datawriter
    DB1 U1 db_ddladmin

    Db2 U1 db_dataReader
    Db2 U1 db_datawriter

    Db2 U2 db_dataReader
    Db2 U2 db_datawriter

    I somehow want it in a way so that the Db_name and USer_name are not repeated .

    IS it possible ?

    thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Its not logically possible to do this in the output format you are using (think about it...). Perhaps you should turn this into a crosstab query?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Sep 2003
    Location
    KY
    Posts
    146

    Ok

    This is what I like to see

    DB1

    U1
    db_datareader
    db_dataWrite
    U2
    db_ddlAdmin
    db_data_reader
    db_datawriter

    DB2 ......

    Please provide some hints .

    thanks

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    That is not a dataset format. That is a report format.

    Yes, you could do this using an unconventional UNION query, but you shouldn't. This kind of formatting should be handled by your reporting interface. MS Access or Crystal Reports can take a standard dataset from SQL Server and format it the way you desire without any trouble.

    QUERY ANALYZER IS NOT A USER INTERFACE OR REPORTING APPLICATION! Don't use it as such.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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