Forum Replies Created

Viewing 15 posts - 91 through 105 (of 110 total)

  • RE: Merge Multipal views into one

    Hi

    Maybe I missed something, but it seems like you already have the functions working inside View1 + View2 and what you need is just to combine those two sets into...

  • RE: no of rows in all tables in a single query

    You might wanna try this trick:

    SELECT

    [TableName] = so.name,

    [RowCount] = MAX(si.rows)

    FROM

    sysobjects so,

    ...

  • RE: Update from multiple records

    Since it is always the last record per person that you want to integrate, make use of the great 2005 feature : ROW_NUMBER() function.

    For a full documentation, please refer to...

  • RE: How to extract continuous data.

    OK, since you're only looking for 3 consecutive days. it was hard for me to tell whether it is best to use recursive or regular CTE. I used regular to...

  • RE: Selecting just one record using ORDER BY

    Hey GSquared

    After a few more tests, I'm now facing a funny situation where my demo code runs fine, but my original code doesn't benefit from that improvement at the same...

  • RE: Help OPENXML is trimming my string values

    OK, then you may try one of the two:

    1. - Raising the limit of the SQL to varchar(1000). After opening the XML test the DATALENGTH of the XML node...

  • RE: Selecting just one record using ORDER BY

    Hey GSquared...

    I think I just solved my own puzzle...

    I added the following filter to the end of the CTE:

    WHERE CTE.permmask>A.RowMasks

    WITH cte

    (

    TotalPrice,

    RowID,

    Combination,

    PermMask

    )

    AS

    (

    SELECT

    TotalPrice = cast(A.SalePrice as int),

    RowID = CAST(BasketSaleRowID as...

  • RE: Help OPENXML is trimming my string values

    Hi Daniel

    Are you trying to achieve data accuracy or an error handling mechanism?

    Won't it be enough if you defined your field as VARCHAR(MAX)? You should enfornce length rules from within...

  • RE: Selecting just one record using ORDER BY

    Hi

    They force you to select unique items. Since this is a CTE that generates permutations, you should select only the combinations that contain all items and each item once only....

  • RE: retreiving data from tempdb

    Hi

    Could you please run the following command and post the results here?

    sp_helpdb tempdb

  • RE: Selecting just one record using ORDER BY

    It goes like this:

    Any roduct can have one of the following prices:

    1 - Ordinary price (no discount)

    2 - some discount (X$, X%, etc)

    3 - 1+1 (if you take two items...

  • RE: Selecting just one record using ORDER BY

    For a moment, I thought you caught me...

    No, unfortunately it will not return the right data, since the recursion will not take place correctly...

    Just to make sure I tried it...

  • RE: Selecting just one record using ORDER BY

    Hi

    Thanks for replying...

    The reason for the misterious select is that the demo data table is a bit more complex in real world, but this does not affect execution time...

  • RE: Recursion in SQL Server 2005

    are you running SQL 2005?

    If so, you can use RECURSIVE CTE.

    The very same example is shown all over google, as well as MSDN.

    Look for it.

  • RE: get the recent publications from each user

    Correct!

    and this is expected as the query first sorts by the partition column (contributor) and only then by the order by column (date published).

    What you should do is add "order...

Viewing 15 posts - 91 through 105 (of 110 total)