Forum Replies Created

Viewing 15 posts - 5,491 through 5,505 (of 8,731 total)

  • RE: Compare Rows in sample Table - T-SQL help

    Here's one possible solution. It creates a way to make a self join with the previous reportrundate for each invoiceno and invoicepart. Feel free to ask any questions that you...

  • RE: help writing this subquery

    There's no need for 2 CTEs.

    WITH cteEmpaddress AS (

    SELECT Eid,

    Addresscode,

    ...

  • RE: Adding certain Rows specific

    Why do you want the result in the 8th row? That should be done in the front end.

    To do a sum like that you need CASE.

    SELECT SUM(CASE WHEN id IN(2,3,4)...

  • RE: Round off to the nearest value

    Or you can use the truncate option of ROUND()

    SELECT ROUND(45.67, 0, 1)

  • RE: Why is "Invalid Object" message in Stored Procedure?

    The problem was that your table names have spaces. That's the reason that you need the square brackets. If you don't change them soon enough it will be a nightmare...

  • RE: T-SQL Development Standards

    Jeff Moden (11/24/2014)


    chenke (2/17/2010)


    I understand this is an old forum, but in effort to add to a discussion that others may benefit from I want to share a document that...

  • RE: Please help with Recursive CTE to get reversed people hierarchy

    SQLRNNR (11/24/2014)


    While looping works fine with small sets, I have found that recursive CTEs will blow the doors off a loop with larger data sets. Where loops will take...

  • RE: Please help with Recursive CTE to get reversed people hierarchy

    This is a bit simpler than Jason's example. Check the way I post the sample data, you're supposed to post it this way to get better help.

    CREATE TABLE employee (

    ...

  • RE: sql server 2008

    This has happened to me when the result set is too large to be displayed. Try returning less rows or use a different client application.

  • RE: tsql with out using cursors

    g.britton (11/21/2014)


    ZZartin (11/21/2014)


    g.britton (11/21/2014)


    ZZartin (11/21/2014)


    Sean Lange (11/21/2014)


    ZZartin (11/21/2014)


    Just out of curiousity but how do you use a cursor without using a while loop?

    Under the hood a cursor is a just...

  • RE: tsql with out using cursors

    Damian-167372 (11/21/2014)


    no one said cursors are bad and should not be used, i have done lots of loops with cursors

    and i also wanted to know how this code can be...

  • RE: tsql with out using cursors

    Sean Lange (11/21/2014)


    ZZartin (11/21/2014)


    Sean Lange (11/21/2014)


    ZZartin (11/21/2014)


    Just out of curiousity but how do you use a cursor without using a while loop?

    Under the hood a cursor is a just a...

  • RE: tsql with out using cursors

    Damian-167372 (11/21/2014)


    Luis Cazares (11/21/2014)


    Damian-167372 (11/21/2014)


    yes your absolutely right I agree table variable is a overhead for this query,

    but for any other large queries I can use this method...

  • RE: tsql with out using cursors

    Damian-167372 (11/21/2014)


    yes your absolutely right I agree table variable is a overhead for this query,

    but for any other large queries I can use this method slightly change to...

  • RE: Are the posted questions getting worse?

    Totally out of context.

    If anyone of you have heard about what has been happening in Mexico these last few days. Would you mind sharing it with me by PM? I'd...

Viewing 15 posts - 5,491 through 5,505 (of 8,731 total)