Forum Replies Created

Viewing 15 posts - 196 through 210 (of 254 total)

  • RE: Select w/ Max

    select a.*

    from table_a a

    join

    (

    select

      loaded_unloaded,

      last_dt = max(scale_dt)

    from table_a

      group by loaded_unloaded

    )t

    on a.loaded_unloaded = t.loaded_unloaded

    and a.scale_dt = t.last_dt

  • RE: Index Maintenance Question SQL Server 2005

    Hi Erich,

    1. How many pages does your index occury ?

    2. Have you tried select * into some_table from your_fragmented_table with creating same inedexes on some_table?

     

     

  • RE: Problem in Numbering rows...

    select

    sciid,

    cityname,

    rownum = when sciid = 4

     then rank() over (partition sciid order by cityname)

     else null

     end

    from city

    order by cityname

  • RE: Query that uses table index

    Yes, that's another reason why it's not 100% guarantee. However you can put

    where text like '%c1%' or text like '%c2%' or text like '%c3%'

    hope it will not return huge number...

  • RE: Query that uses table index

    Hi Yuri,

    I had similar problem in a past, and here is how I solved it. However this method is not 100% guarantee that you will catch that SQL because it...

  • RE: How does this work?

    Hi Amit. Is it possible to do the same for grouping ?

  • RE: how to validate if an Index has been disabled?

    select

    * from sys.indexes

    where

    is_disabled = 1

  • RE: Eliminate Duplicate rows

    alter

    table emp add row_number int identity

    go

    delete

    emp

    from

    ...

  • RE: Eliminate Duplicate rows

    It sounds like the problem is with design. To get only one record for each 100 and 101 I would recommend to normalize design of this table - to have...

  • RE: query not using index properly

    Did you check your execution plan ?

    What is the reason that optimizer does not use indexes ?

    Is empty string is majority of records ?

    Have statistics been updated recently...

  • RE: Book on SQL 2005

    The good book about 2005 which I like and highly recommend is Pro SQL Server 2005, by Thomas Rizzo, Apress.

  • RE: Need max() function by record not column

    Thanks Peter, I liked your solution. I already implemented it for my situation.

  • RE: Length of varchar(max) for variables

    Yes Steve, it looks as it keeps entire string internally, but does not print it to output, even to a file.

    So I will probably use methodology suggested by Chris, to print...

  • RE: Length of varchar(max) for variables

    Hi Steve,

    Yes, by the output I mean SSMS results window, but when I save it to a file it cuts this string too.

    Here is quick script to test it:

    set nocount...

  • RE: about indexes

    You can also create a computed column where you will Checksum(your original column), then create a index on it.

Viewing 15 posts - 196 through 210 (of 254 total)