Forum Replies Created

Viewing 15 posts - 121 through 135 (of 203 total)

  • RE: what does the second @@error return?

    Good question, I liked it. Starting from SQL Server 2005, getting the error information from the @@error is certainly becoming less popular due to availability of the structured error handling...

  • RE: Converting to DateTime

    latingntlman (4/23/2010)


    You're right, the EndDate value was a typo...my bad. I'm implementing your second suggestion b/c it may carry to the next day, however, if the diff is 24...

  • RE: Converting to DateTime

    Lowell,

    Looks like all it will take is to add - 1 to [months] and [days] portion.

    [Months] = datepart(month,ET-ST) -1,

    [Days] = datepart(day,ET-ST) -1

    Cool script though, will definitely land in the...

  • RE: Converting to DateTime

    Lowell (4/23/2010)


    now that you have the two vals as datetime, it should be easy;

    here's some examples i've saved that pulls out the peices; you can concat them togeter for the...

  • RE: Converting to DateTime

    latingntlman (4/23/2010)


    Now that I have starttime/endtime as:

    StartDate: 2010-04-20 16:58:18.000

    EndDate: 2010-04-20 26:59:56.000

    I need to calculate the difference as "TimeTaken" and show it in hh:mm:ss

    What would be an effective wa...

  • RE: Views

    CirquedeSQLeil (4/21/2010)[hr

    I still disagree. This is used as a catch-all to avoid teaching moments. I don't use the ; at the beginning of the cte, but rather as...

  • RE: Views

    Hugo Kornelis (4/21/2010)


    Oleg Netchaev (4/21/2010)


    Since that time I got into habit of always starting the cte expression with a semicolon

    I never understand that habit. The semicolon is a statement terminator,...

  • RE: Views

    Good question! Thank you Ron.

    About 2 years ago I read the BOL reference article on common table expressions and since that time I clearly remember that it stated in the...

  • RE: Understanding and Using APPLY (Part 2)

    After reading Part I last week I knew that Part II is going to be good, but I did not expect it to be this good! This was easy to...

  • RE: Model.mdb

    This is a good question, thank you Ron. I think that though model can be set to read-only, perhaps this action is simply ill-advised, that is all. What I mean...

  • RE: Rowcount and multiple assignment

    sjimmo (4/14/2010)


    Oleg,

    insert into #n

    select

    top 3 row_number() over (order by [object_id])

    from sys.objects;

    is not the...

  • RE: Rowcount and multiple assignment

    Rune Bivrin (4/14/2010)


    It's important to note that SET @result = cast (@@rowcount as varchar) does NOT change @@ROWCOUNT. The first 1 comes from the last INSERT #n VALUES(3).

    This is one...

  • RE: Understanding and Using APPLY (Part 1)

    Thank you Paul for excellent article, I thoroughly enjoyed reading it. Looking forward to read Part II next week. I usually start using new language features pretty soon after they...

  • RE: Rowcount and multiple assignment

    This is a great question, I really, really enjoyed it. The most difficult part was to figure out that the line:

    set @result = cast (@@rowcount as varchar)

    does 2 things:

    1....

  • RE: NULL

    This is a poorly worded question with questionable options. I only answered it "correctly" because I wanted my point, and the author's desire to have "UNKNOWN" as the right answer...

Viewing 15 posts - 121 through 135 (of 203 total)