Forum Replies Created

Viewing 15 posts - 991 through 1,005 (of 1,347 total)

  • RE: Problem with Stored Procedure with Temporary Table

    Why are you turning NOCOUNT off, when there are statements in there (eg the INSERT INTO) which will generate rowcount messages ?

  • RE: Help with query

    SELECT DISTINCT

      CASE

        WHEN Member_1 < Member_2

        THEN Member_1

        ELSE Member_2

      END As Member_1,

      CASE

        WHEN Member_1 > Member_2

        THEN Member_1

        ELSE Member_2

      END As Member_2

    FROM YourTable

  • RE: Inconsistent Query Results

    Which 1 of these 2 statements from the initial post & subsequent replies above is actually correct ?

    >>The 'recordid' column is an IDENTITY column in both tables.

    >>Table D:  recordid is VARCHAR(50)

     

  • RE: Inconsistent Query Results

    Please post the DDL of the tables. It may also help to post the results of using SET SHOWPLAN_TEXT ON, with the 2 alternative queries.

  • RE: Insert the results of a stored procedure into a table

    This thread is 14 months old ... chances are they have the answer by now

  • RE: optimize this query?

    If there's no index on EVENT_DATE, you're unlikely to do much better.

    If there was an index, this might perform better, depending on the type of index and selectivity etc:

    SELECT *

    FROM...

  • RE: Cant execute sql script twice

    Your query to get data uses a left join but:

    >>AND tbl_assignment.resultcode = 'DNS'

    You reference the left-joined table in the where clause thereby implicitly converting it to an inner join.

    I'm not...

  • RE: Cursor updating all records.

    The set-based solution will scale better to a larger table. It will also translate easily to the new ROW_NUMBER ranking function coming in Sql Server 2005 that will get rid...

  • RE: Cursor updating all records.

    Why are you using a cursor ?

    Select Identity(int, 1, 1) As NewValue,

      WorkSitePKEY

    Into #Sequence

    From WorkSite

    Where Cred_ID IS NULL

    Update WorkSite

    Set Cred_ID = Cast( s.NewValue As varchar(10) )

    From WorkSite As w

    Inner Join...

  • RE: SP syntax

    Are there any triggers defined on table 'Appointment' and are you aware of how that impacts @@IDENTITY and SCOPE_IDENTITY() ifthis is the case ?

    Have you tried using SELECT instead of...

  • RE: Reasons Against Clustered Index

    However ... you can't specify a FillFactor on a heap.

    Since you only Update throughout the year, and since those updates are on int columns that don't cause page splitting, you...

  • RE: Truncate and Delete

    More differences:

    Truncate cannot be used if there are foreign keys referencing the table.

    Truncate resets any Identity columns to their Seed value, Delete does not.

  • RE: DB Design Question

    The design isn't "wrong", as long as some assumptions hold true. eg: Can a player be on more than 1 team ? Assumption is No.

    Given that:

    Select dt.TeamNum, p1.Name As Player1Name,...

  • RE: Problems with cursor selecting from a view

    >> And it shouldn't take minutes to retrieve the first row. 

    That depends on many factors.

    An ORDER BY potentially causes the optimizer to select a different query execution plan. Depending on...

  • RE: Problems with cursor selecting from a view

    >>Within the sproc, it hangs at the first fetch after the OPEN CURSOR stmt.

    How do you *know* it hangs ? What are you using to diagnose this ? Maybe it's...

Viewing 15 posts - 991 through 1,005 (of 1,347 total)