Forum Replies Created

Viewing 15 posts - 3,466 through 3,480 (of 4,087 total)

  • RE: all OutputList nodes from different parent nodes?

    Use the '//' that you want to find all occurrences. Something like p.query_plan.nodes('//sp:RelOp/sp:OutputList/sp:ColumnReference')

    Drew

  • RE: grouping by regions except in one case

    mgoldade (11/28/2011)


    However, the desire is that online courses print in ALL groupings AND as their own section for the students who only take courses online.

    Remember that CASE is a "function"...

  • RE: error message for t-sql query

    It means pretty much what it says. You don't have a table named or aliased "table3" in your query. You can't reference a column in a table that...

  • RE: Get Data from XML Nodes for multiple rows

    XML is case-sensitive. That appears to include the .nodes() function.

    Drew

  • RE: T-SQL QUERY TO RETURN SOME DATA

    Cadavre (11/23/2011)


    Ahhh, beaten to the punch.

    Not necessarily. On my sample data, using IN outperforms using NOT IN by a significant margin. I assume that this will mainly be...

  • RE: Replace CASE with PIVOT

    New does not necessarily mean better. (In fact with MS it often means buggy.) Jeff Moden shows in his article

    Cross Tabs and Pivots, Part 1 – Converting...

  • RE: Loop through multiple tables

    memymasta (11/23/2011)


    The logics is we need to loop through every user to send email to each one. Also we need to loop through items so we can add them to...

  • RE: Calculating Percentage using a CTE Or with a COUNT(*) OVER Clause

    Welsh Corgi (11/22/2011)


    The following does not right justify the percentage:

    Justification is a presentation issue and should be handled by the presentation layer not in T-SQL.

    Drew

  • RE: Calculating Percentage using a CTE Or with a COUNT(*) OVER Clause

    100.00 * Sum(Sale)/NULLIF(Sum(Quote), 0)

    This makes sure that you are not performing integer division and also produces a null result when Sum(Quote) is zero.

    Drew

  • RE: Two databases - same instance - query both

    Bron Tamulis (11/22/2011)


    select

    NBXWEB.dbo.RBI_POReceipts.PONUM,

    NBXWEB.dbo.RBI_POReceipts.Vendor,

    NBXWEB.dbo.RBI_POReceipts.RecDate,

    NBXWEB.dbo.RBI_POReceipts.SKU,

    NBXWEB.dbo.RBI_POReceipts.QtyReceived,

    NBXWEB.dbo.RBI_POReceipts.ReadByGP,

    RBI.dbo.BT_POP_QTY_REMAIN.REMAIN

    from NBXWEB.dbo.RBI_PORECEIPTS FirstAlias

    Left outer Join RBI.dbo.BT_POP_QTY_REMAIN SecondAlias

    ON FirstAlias.PONUM = SecondAlias.PONUMBER and FirstAlias.SKU = SecondAlias.ITEMNMBR

    Once you define an alias on the table any...

  • RE: YTD Summary report

    The first step is to choose the correct tool for the job. In this case, the correct tool is reporting software, such as SSRS, not T-SQL. This kind...

  • RE: help with multi-path hierarchical data

    Mark-101232 (11/22/2011)


    I think this is known as a directed graph

    In order for the recursive CTEs to work, it actually needs to be a directed acyclic graph, i.e., it can't have...

  • RE: Delete data from SQL using Excel 2010

    Excel is a spreadsheet program, not a database program. It makes a terrible database program.

    Excel is a spreadsheet program, not a user interface design program. It makes a...

  • RE: Query xml column

    Remember what i said about relative paths? All of your paths are absolute. (They start with a '/'.) You need to use relative paths. The '.',...

  • RE: Issue with multi selection option in dropdown list

    Yes, it's a T-SQL question, but you posted in both the T-SQL (SS2K5) and the T-SQL (SS2K8) forums. I assume you know whether your server is SQL 2005 or...

Viewing 15 posts - 3,466 through 3,480 (of 4,087 total)