Forum Replies Created

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

  • 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...

  • RE: Case in Where with Null

    I guess that my test case is wrong because when I run this :

    set ansi_nulls off

    Declare @FkParentOBJ as int

    SET @FkParentOBJ = null

    Select top 10 * from dbo.ObjSQL WHERE FkParentOBJ...

  • RE: Select only stand alone statistics to drop

    How's this for reverse engineering :

    Select Object_name(id) as TableName, 'DROP STATISTICS [' + Object_name(id) +'].[' + name + ']' from dbo.SysIndexes where indid > 0 and indid 0...

  • RE: How to get available memory using SQL

    It's not a table : run this in the master table

    Select objectproperty(object_id('sysperfinfo'), 'TableIsFake')

    It will return 1. This means than when you query that table, Sql server meterializes it so...

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