Forum Replies Created

Viewing 15 posts - 18,451 through 18,465 (of 18,926 total)

  • RE: Select only stand alone statistics to drop

    Actually it would be better to use my query because I query SysIndexes only once and would use only 1 cursor. While your current code queries SysIndexes for every...

  • RE: Way to get full @@rowcount even when using "top"?

    I've run in a situation like this before. Is the data from the report static or can it be changed in the execution of the report?

    if the data is...

  • RE: Way to get full @@rowcount even when using "top"?

    Execution plan + profiler with DBCC DROPCLEANBUFFERS between batches is usually what I use.

    However a good rule of thumb is to move as little data as possibble and also to...

  • RE: Nested Subquery

    You mean this?

    Select Account, DenialDate, Location, DenialCode, SUM(DeniedCharge) as SumDeniedCharge

    GROUP BY Account, DenialDate, Location, DenialCode

    Or this?

    Select A.Account, A.DenialDate, A.Location, A.DenialCode, SUM(A.DeniedCharge) as SumDeniedCharge

    (Select Distinct Account, DenialDate, Location, DenialCode, DeniedCharge) A

    GROUP...

  • RE: Case in Where with Null

    Plan 1 and 3 are extactly the same. Obviously the isnull() plan takes 60% of the load which is expected.

    R u getting different execution plan for the first and last...

  • RE: Way to get full @@rowcount even when using "top"?

    Looks like we're saying the same thing.

    which of these is the closer to what you are thinking?

    execute search into temp table without top 10

    gives @@rowcount

    select top 10 from temp table

    or

    Execute...

  • RE: Table Variable

    UPDATE

    pos

    SET

    pos.prev_yield = prev.prev_yield

    FROM

    @tbl_Position_Previous_Day prev inner join

    @tbl_Position pos

    on

    prev.sec_id

    = pos.sec_id

    AND

    prev.tick_lot

    = pos.tick_lot

  • RE: Way to get full @@rowcount even when using "top"?

    Actually what he wants to accomplish is :

    insert into @Table

    Select * from ?? where .....

    set @MyRowCount = @@RowCount

    Select top 10 * from @Table

  • RE: Table Variable

    Here's an exemple of one of my procs :

    UPDATE F SET NewRank = dtMatchedRanks.AvailableRanking

    FROM @ForcedMoves F INNER JOIN

    (SELECT CurrentRank, AvailableRanking

    FROM

    (SELECT TOP 100 PERCENT Count(*) AS Temp_id, F1.CurrentRank

    FROM @ForcedMoves...

  • RE: Table Variable

    Yes you can.

  • RE: Select only stand alone statistics to drop

    This doesn't seem to be a system stat, maybe it's a user stat that the system is using... or some index type that I don't know.

    Are you sure that my...

  • RE: Way to get full @@rowcount even when using "top"?

    Won't this query be run multiple times

    (select count(*) from authors) since it's a sub query

    ?

    if I run this

    use northwind

    go

    SET STATISTICS IO ON

    select top 10 *, (select count(*) from...

  • RE: Nested Subquery

    I didn't read the whole post... but from your last question :

    Select DenialDate, Location, DenialCode, SUM(DeniedCharge) as SumDeniedCharge

    GROUP BY DenialDate, Location,DenialCode

  • RE: Select only stand alone statistics to drop

    Forgot to mention this :

    indid >>

    1 = Clustered index

    >1 = non clustered

    255 = used if the table as binary or text field(s)

    0 = no clustered index

    [EDITED]

    0 = HEAP

  • RE: Select only stand alone statistics to drop

    This is still personal preference :

    1 - Cursor = £@£½¤¢¤[¼¢8(*?%(*?/$ £¢¤£¢¤

    however I agree that they have their utility once in a while... especially hwen doing admin stuff like this.

    2...

Viewing 15 posts - 18,451 through 18,465 (of 18,926 total)