Forum Replies Created

Viewing 15 posts - 451 through 465 (of 1,229 total)

  • RE: Should I use a nested subquery?

    thomasrichardson2000 (10/11/2012)


    RepairSheetNrunitnrgroupidbrandIdmodelIdversionType_Fleetclose_dateTotalModels

    500000384EDMNFIATGRANDE PUNTO 1.28V DYNAMIC 5DROF 2012-07-31 00:00:00.0001

    Sorry the query ran fine, it just returned the exact same result set as the...

  • RE: Should I use a nested subquery?

    thomasrichardson2000 (10/11/2012)


    Didn't work just pulled back the same result set, I need the query to be able to search the vehicle table for all the modelid on the fleet at...

  • RE: please help with query

    -- sample data

    ;WITH

    MySample (ID, notes, account1, account2, account3, account4, account5) AS (

    SELECT 1, 'notes', 1, 0, 1, 0, 1 UNION ALL

    SELECT 2, 'notes', 0, 1, 0, 1, 0...

  • RE: Function or Join

    Dhirju (10/11/2012)


    which is better for performance wise,

    function or join?

    thanks

    An inline table-valued function can perform equally as well as a join to tables. If the function has BEGIN/END in it,...

  • RE: Should I use a nested subquery?

    Do you get different results with/without the DISTINCT?

    Here's a reformatted copy of the query. I've added table aliases to make it a little more readable and changed the order of...

  • RE: Checking for a string until if finds, then insert that into new table

    Skanda (10/11/2012)


    Am using below query, but it is not working.

    select record_id,

    if Col1= 'Student'

    Begin

    Insert record_id, Student as Stud into new_table

    end

    else if Col2 = 'Student'

    Begin

    Insert record_id, Student as Stud into new_table

    end

    else...

  • RE: Update a Record Using a Trigger with SELECT Statement

    What's the UPDATE statement you are using, and is there any reason why it can't include VLoadnoteCarr?

  • RE: Help on Performance issue on Recursive CTE

    Can you make ParentID a non-unique clustered index? It will almost certainly improve performance. Might as well remove the TOP 100 PERCENT too, it's only pretending to do something.

  • RE: Delete existing records, after inserting new record

    Skanda (10/11/2012)


    hi,

    as per my requeirement when ever i insert new record, existing record should be deleted.

    What denotes "existing record"? How do you identify it?

    Why don't you use UPDATE instead of...

  • RE: Delete existing records, after inserting new record

    Skanda (10/11/2012)


    Hi

    i want to delete existing records from sql table, after inserting new record.

    am using below code...

    CREATE trigger Del_records on Active_Table

    AFTER insert

    as

    delete from Active_Table

    but it is deleting all records

    plz...

  • RE: OPTION (RECOMPILE, QUERYTRACEON 8649)

    aadharjoshi (10/11/2012)


    Thank you all..!

    I appreciate your help.. Most probably i can remove in clause and use inner join..

    Folks here would be happy to help you tune your query. Can you...

  • RE: OPTION (RECOMPILE, QUERYTRACEON 8649)

    Jason-299789 (10/11/2012)


    ...as you're getting rid of a potentially expensive IN statement and using an Inner join from a CTE, the variable is no longer on the join and in the...

  • RE: SQL Server Linked Server Distributed Query with Parameter vs Literal

    The filter is being applied locally. You could use EXEC with dynamic SQL as Chandan suggests; I'd personally use OPENQUERY, which will also require your statement to be constructed as...

  • RE: OPTION (RECOMPILE, QUERYTRACEON 8649)

    aadharjoshi (10/10/2012)


    What OPTION (RECOMPILE, QUERYTRACEON 8649) will do when i add it to query?

    eg..

    SELECT COUNT(T.CompanyID),

    COUNT(UserDataID)

    FROM...

  • RE: OPTION (RECOMPILE, QUERYTRACEON 8649)

    aadharjoshi (10/10/2012)


    What OPTION (RECOMPILE, QUERYTRACEON 8649) will do when i add it to query?

    ...

    RECOMPILE

    QUERYTRACEON 8649

    If you suspect you are experiencing performance problems with one or more of your queries,...

Viewing 15 posts - 451 through 465 (of 1,229 total)