Forum Replies Created

Viewing 15 posts - 1,126 through 1,140 (of 2,171 total)

  • RE: Set-Based Solution Possible?

    Here is another approach with no ridiculus tally table pinned into memory, where more vital information can be stored and used.

    With the original sample data, there is now only 67...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Set-Based Solution Possible?

    Mike Nuessler (1/31/2008)


    Interesting.

    I am going to modify your suggestion as required for my needs and run it on production data against my modified Sergiy method and see what happens.

    When...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: SQL Query

    Also asked here

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=96535


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Set-Based Solution Possible?

    I used

    CREATE CLUSTERED INDEX IX_Yak ON TestData (StaffName, ReviewDate)

    Please reread my previous post with timings and execution plans involved.

    My suggestion only needs 32 reads whereas Sergiy needs 4385 reads...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Set-Based Solution Possible?

    What? I have only two table scans. And if you index the #TestData table properly you will get two clustered index scans only!

    Peso with 32 reads

    |--Compute Scalar

    ...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Set-Based Solution Possible?

    And this how you do it in SQL Server 2005 with only valid member (member has a reviewdate in wanted range)SELECTCASE WHEN u.RecID = 1 THEN u.StaffName ELSE '' END...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Set-Based Solution Possible?

    This is how you do it in SQL Server 2005 with all members includedSELECTCASE WHEN u.RecID = 1 THEN u.StaffName ELSE '' END AS StaffName,

    MAX(CASE WHEN u.ReviewDate LIKE '2006%' THEN...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Set-Based Solution Possible?

    Why use UPDATE at all? Or use a function? This is possible to do in a single query.

    And still have some options to include or exclude "non-valid" members!

    SELECTCASE WHEN u.theIndex...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: SubQuery returning more one record

    Replace DISTINCT with TOP 1 in the correlated subquery.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Delete Table Rows + Reset Seed

    DBCC CHECKIDENT can be used to reseed the identity value.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Updating a number of records

    Use OPENROWSET function together with INNER JOIN.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Slower and slower.. what will you do...?

    Or create a unique constraint (or check the ignore duplicate key) on the existing index.

    then you always can insert directly and if a record exists, you will get a warning.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Removing trailing spaces in a table column

    LEN() function is NOT counting trailing spaces.

    DATALENGTH() does.

    Are you the spaces really are spaces (ascii value 32)?

    Make sure they are not hard-spaces (ascii value 160).


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: dateadd function

    I don't think points are valid date separator for style 103.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: help about dateadd

    I don't think points are valid date separator for style 103.


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 1,126 through 1,140 (of 2,171 total)