Forum Replies Created

Viewing 15 posts - 496 through 510 (of 1,183 total)

  • RE: Can my code be simplified and made to work?

    Without looking too deeply, because I don't have the time right now. You should get a performance boost by removing the ORDER BY's

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Shifting columns

    Good catch Sergiy 😛

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Shifting columns

    No need to PIVOT or CROSSTAB, even though they'll both work ....

    -- create a table for sample data

    DECLARE @t TABLE

    (RowID Char(16)

    ,Code1...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: *= VS left outer join

    if you later have

    table1.col4 = table2.col4

    in the where clause then it's an inner join

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: *= VS left outer join

    Nope, in that use they are equivalent.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Need to SUM( ) two different COUNT(*) columns

    Please post the code you've tried.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: dynamic variable?

    Matt Miller (5/14/2008)


    By the way - Jason has a small typo (the source of your errors) in his 2000-compatible version:

    SELECT

    a.name

    ,reg_hrs

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: dynamic variable?

    Under Properties > Options for the database. But if it's SQL 2000, the CTE will not work.

    Try this instead.

    SELECT

    a.name

    ,reg_hrs

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: dynamic variable?

    Are you using SQL 2005?

    Compatibility Level set to 90?

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: dynamic variable?

    Place a semi-colon at the end of the line immediately before the WITH statement.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: dynamic variable?

    I'm not sure I understand why you want a "variable" Are you trying to avoid performing the aggregation more than one time?

    If so then ....

    WITH totals

    AS (SELECT

    ...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: model database

    The model database is "copied" when you create a new database. So if you create a table in it, such as a tally or numbers table. Then all subsequent databases...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: comma separated cell data into rows

    Search for SPLIT function on this site. You'll most likely need a variation of that.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Find Extra Spaces

    Lookup LTRIM in BOL.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • RE: Data Driven Subscriptions Updated

    Helen Thorley (5/13/2008)


    Hello,

    This works perfectly for me when run once - but won't "re-run".

    Every subsequent attempt results in an report status of 'Root element is missing'.

    I've checked the Subscriptions and...

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 15 posts - 496 through 510 (of 1,183 total)