Trace Table Query

  • HI,

    select Hostname,SPID, startTime, EndTime, duration from Bribs_Trace_25032011

    where loginname='Bribs' and endtime is not null

    Group by Hostname,SPID, startTime, EndTime, duration

    Order by SPID, duration

    This query wroking fine

    I want to modify tes

    select textdata, Hostname,SPID, startTime, EndTime, duration, servername from Bribs_Trace_25032011

    where loginname='Bribs' and endtime is not null

    Group by textdata,Hostname,SPID, startTime, EndTime, duration, servername

    Order by SPID, duration

    Server: Msg 306, Level 16, State 2, Line 1

    The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator.

    Please give me solution, how to modify this Query?

    Thanks

    ananda

  • Why are you grouping at all? Group By is for controlling data break-down on aggregate functions.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Thanks for reply--

    Group by function - need to specify for all select column..

  • ananda.murugesan (3/25/2011)


    Thanks for reply--

    Group by function - need to specify for all select column..

    Why? For this query, it's not doing anything useful that I can see.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • ananda.murugesan (3/25/2011)


    Thanks for reply--

    Group by function - need to specify for all select column..

    You're not doing any form of aggregation, so the group by is completely unnecessary.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for yours reply ....

  • Please tell me, SQL Profiler trace data duration column is Mi.Sec or Sec?

    thanks

  • On SQL 2000 it's in milliseconds

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply