Forum Replies Created

Viewing 15 posts - 661 through 675 (of 1,473 total)

  • RE: Request help with a query

    Bob Hovious (9/15/2009)


    To avoid confusing screen display times with runtimes, I'm just tracking the milliseconds to write to a temporary table. On my laptop, the CTE/RowNumber solution...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Request help with a query

    From previous debates comparing things like derived tables vs. correlated subqueries, I believe the result always comes down to the optimizer.

    Very simple subqueries with outer references are typically...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: practical RBAR removal: convert integers to binary

    Gabriel P (9/15/2009)


    Garadin (9/15/2009)


    That recursive CTE is probably the coolest piece of code I've seen in quite a while. Makes me realize you can apply them to more than...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: practical RBAR removal: convert integers to binary

    That recursive CTE is probably the coolest piece of code I've seen in quite a while. Makes me realize you can apply them to more than just hierarchies.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Save Source Code with line breaks in Table

    David.Maron (9/15/2009)


    That's what i wanted to do. Every change to the database should be logged.

    If you have source controll in subversion etc. there is still the possibility to make changes...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Save Source Code with line breaks in Table

    The history table you're making could likely be used with the DDL triggers in 2005 to be pseudo source control. Just make a DDL trigger for ALTER_PROCEDURE (Optionally create...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Save Source Code with line breaks in Table

    HowardW (9/15/2009)


    sys.sql_modules preserves line breaks, it's the SSMS grid view that doesn't. If you return the results to text, you'll see that the line breaks are there.

    I was just about...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Group by Count question

    Jonathan (9/15/2009)


    ALL

    This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Generate MAc addresses with a stored procedure

    Beyond which, I personally don't know the exact schema / rules for MAC addresses. Maybe I'm the only one. I'm sure I could google it and find it...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Group by Count question

    All better. No more replies from me until I've had some coffee! Great reminder about ALL keyword Howard.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Group by Count question

    tnocella (9/15/2009)


    I'm using a Group By statement to count items, such as the statement below. It works, the only problem is if the count is 0 for a department, it...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: Code to acomodate year starting in April

    pwatson (9/15/2009)


    Garadin, I was thinking of creating a new "Date" table with the new values (same columns as the previous table), week no 1 starting on the last Sunday of...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: how to change rows to columns

    Let's try to keep this consolidated. Arun has already posted some code in this thread. Any replies here please.

    http://www.sqlservercentral.com/Forums/Topic787173-338-1.aspx

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: how to change rows to columns

    This is now the 7th time you've posted this same thing. What's the deal? Beyond the repeated posting, you've been around long enough to know that the way...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

  • RE: How to combine all this in one query?

    You should be able to do something like this:

    SELECT C.DateGroup,

    SUM(I2.Code) FTE

    FROM DOCTOR A

    INNER JOIN DOCTOR_SURGERY B ON A.DOCTOR_SURGERY_ID = B.DOCTOR_SURGERY_ID

    INNER JOIN (

    SELECT B.Doctor_Surgery_ID,

    CASE

    ...

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]

Viewing 15 posts - 661 through 675 (of 1,473 total)