Forum Replies Created

Viewing 15 posts - 31 through 45 (of 824 total)

  • RE: Sometimes get IndexScan instead of IndexSeek

    I should add that as long as the seek predicate on t1 is indexed and all the required columns are included that should get you an index seek on...

  • RE: Sometimes get IndexScan instead of IndexSeek

    If I understand what you are getting at you should use a NOT EXISTS query like this:

    select t1.col1,

    t1.col2,...

    from t1

    where not exists

    (

    select *

    from t2

    where t1.PkCol = t2.FkCol

    )

    This will return all...

  • RE: Alerts - Best Practice?

    We used to use Database Mail, but stopped for several reasons. We now just write events to the Windows Event Logs and then use Nagios to scan them and...

  • RE: MSSQL Server with 16GB RAM 32-Bit 2k3 takes longer to restore same database

    Yep, restores are all about the I/O, and possibly network if you are restoring across a network.

  • RE: Database archive ? - Fast help please.....

    The problem is that archiving typically isn't something that can just be thrown together quickly. It takes careful planning and testing to get it right. If this is...

  • RE: Is This The Best Way to Remove Duplicate Records ?

    Well, that article describes several ways to approach the problem, but without knowing the details it's impossible to say.

    That article addresses the situation where the duplicates are completely duplicates, more...

  • RE: Indexed views and Indexes

    The indexes created on a view are completely separate from the indexes on any of the base tables the view queries. The first index that MUST be created on...

  • RE: Null vs Blanks

    NULL is undefined. It's the absence of a value. A blank is a value, what it might mean and when it is acceptable is entirely up to the...

  • RE: query GROUP BY and HAVING multiple columns on SELECT.

    Try something like this:

    select s.id_state, t.name

    from

    (

    select id_state

    from towns

    group by id_state

    having count(*) > 1

    )s

    join towns t

    on s.id_state = t.id_state

  • RE: Design help needed

    This is a super simplified version, but I think you should get the idea...

    create table student (firstname varchar(25) primary key)

    go

    create table class (className varchar(25) primary key)

    go

    ...

  • RE: How to return a certain percentage of rows (NOT TOP PERCENT QUESTION)

    This is a weird one...

    would something like this do the trick?

    declare @Total decimal(18,2)

    select @Total = sum(number)

    from #temp

    create table #temp2

    (

    customer varchar(15),

    number int,

    Ranking int

    )

    insert #temp2

    select customer,

    Number,

    ranking = row_number() over(order by number desc)

    from...

  • RE: Slow running view

    Paul White (6/25/2009)


    DCPeterson (6/25/2009)


    A clustered index is ALWAYS unique.

    Was this reply prompted by my post?

    If so, I think you might have missed what I was driving at 🙂

    If you get...

  • RE: long runing simple query

    Well sure, but in my tests except performs better than the NOT IN equivalent... Plus that does nothing to explain why it takes so much longer when you add...

  • RE: long runing simple query

    At first blush this looks like a case of a bad execution plan. Can you post the execution plan?

  • RE: Slow running view

    The thing to look for in the execution plan (the one with the index hint) is that there will be a nonclustered index seek and then a bookmark lookup to...

Viewing 15 posts - 31 through 45 (of 824 total)