Forum Replies Created

Viewing 15 posts - 526 through 540 (of 1,183 total)

  • RE: Insert into...select from with an identity column

    Yes, we all know too well that sometimes the hardest problem we work on is right in front of our face. :hehe:

    ______________________________________________________________________

    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: Adding a column header on count function

    You're close ...

    select count(*) as employeeCnt from foo

    ______________________________________________________________________

    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: Insert into...select from with an identity column

    If the target table has an identity column defined, then don't include it in your insert statement and it will be automatically populated at the time of insert.

    ______________________________________________________________________

    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: IT salary is going down !

    Grant Fritchey (4/29/2008)


    It sure beats working on a nuclear powered submarine in terms of pay, benefits, hours, cleanliness... Yeah, I'd say it's still a good career.

    Jeff Moden (4/29/2008)


    I guess I...

    ______________________________________________________________________

    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: Conditional Union

    You can't do that type of conditional logic in views. Study up on stored procedures. 😀

    ______________________________________________________________________

    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: Fight against SET BASED and CURSOR

    then just change the CTE to a temp table. 😀

    CREATE TABLE #pridLimits (prid VARCHAR(55), minDate DATETIME, maxDate DATETIME)

    INSERT #pridLimits

    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: Fight against SET BASED and CURSOR

    Karthik,

    Take a look at this. It does what you want. See if you understand it, and if you should have any questions, I'd be happy to answer them... 😀

    DECLARE @NullPform...

    ______________________________________________________________________

    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: Help on writing code in a way other than using SQL cursor

    OOPS, you need to add in a zero, for the date selected to show up...

    WITH mData

    AS (SELECT

    DATEDIFF(DAY,date_enrolled,'4/16/2008') AS dayNumber,

    ...

    ______________________________________________________________________

    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: Help on writing code in a way other than using SQL cursor

    Set up test data ...

    DECLARE @booksdata TABLE

    (date_enrolled [datetime],

    book_name varchar(50),

    author_name varchar(100),

    book_visited float)

    ...

    ______________________________________________________________________

    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: Help on writing code in a way other than using SQL cursor

    Can there be more than one book_visted for one enrolled_date, or is that a count? Is there a maximum number of days they can 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: Help on writing code in a way other than using SQL cursor

    Please post your CREATE TABLE statement and some sample data (in the form of an INSERT statement) so we can help you more effectively. 😀

    ______________________________________________________________________

    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: Fight against SET BASED and CURSOR

    Karthik,

    What is it that you are trying to accomplish? I understand that you want to go "Set Based", but what is the goal of the procedure?

    ______________________________________________________________________

    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: TSQL - Conditional Check

    ABC will never equal NULL.

    you'd need to rewrite it. One possibility is

    SELECT

    ...

    WHERE

    (ABC IS NULL AND @abc = '')

    ...

    ______________________________________________________________________

    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: compatibility level 80 and 90

    Since you have 2 instances of that column, you need to tell SQL which one to order by ..

    select distinct a.cwono , a.dorder, a.drequest, a.lhold, a.csono, a.ccustno

    from miword...

    ______________________________________________________________________

    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: is there any other alternative to write this query

    chinna (4/23/2008)


    i am a bit weak in sql coding so let me know if it satisfies my condition which is if all the 4 columns are zero then we use...

    ______________________________________________________________________

    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 - 526 through 540 (of 1,183 total)