Forum Replies Created

Viewing 15 posts - 901 through 915 (of 4,080 total)

  • RE: SQL Server Query Help

    Here is the query to give you the results you want.

    I assume you can write the stored procedure to pass in a parameter to a WHERE clause.

    ;with...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Data Rollup

    Is there an upper limit to how many descriptions might have to be concatenated?

    If so, how many? 10? 20? 100? 1000?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: (Re)Sorting records

    Glad it's working for you. I just hope you don't have too many rows in these user tables, because that is NOT going to scale well.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Complex Join and Group By

    You're welcome. I'm sure you'll find enough to get you started, but don't hesitate to come back if you have specific questions.

    By the way, PIVOT is an...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: (Re)Sorting records

    Sorry to take so long. My daughter called from NZ and she gets priority 🙂

    Anyway, I think this will give you the results you want. Use...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: (Re)Sorting records

    Coming right up.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: (Re)Sorting records

    But the IDs should remain the same, only the sort value will change on each row. Right?

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: (Re)Sorting records

    I think I understand the problem now. He wants the [Sort] columns for all rows with a number equal to or greater to the "moved" row to be...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: (Re)Sorting records

    What troubles me is the idea that you are trying to store rows in a specific order in a table. This isn't a spreadsheet or a flat file,...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Complex Join and Group By

    The output you want is commonly referred to as a PIVOT or cross-tab ("crosstab"). If you'll search this site using those terms, you'll find plenty of examples....

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: Error : Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)" in SQL 2005

    :crazy:

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: iterating timeid

    We need some use cases. Please post up what your current source table(s) look like and the query as it has been developed so far. ...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: IF versus CASE statements

    It helps to remember that CASE is an expression, not a statement.

    CASE is basically like a function with "if logic" built in, a more powerful version of ISNULL() or COALESCE().

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: SET BASED QUERY

    drew.allen (11/9/2011)


    The other option is to use the OUTPUT clause to return ALL of the new IDs rather than just the LAST new ID that you would get with scope...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

  • RE: SET BASED QUERY

    You do it with two separate queries. One to update table "B" and then another to update table "C".

    You are thinking procedurally, not set-based, whenever you say...

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills

Viewing 15 posts - 901 through 915 (of 4,080 total)