Forum Replies Created

Viewing 15 posts - 11,326 through 11,340 (of 26,486 total)

  • RE: That Nuisance 1418 SQL Error on SQL 2008 when trying to mirror

    For the community, sonia.burns will be posting an update shortly. We were able to figure out what was going on after numberous emails back and forth during the day.

    We...

  • RE: Simple select by max date

    Try this with the appropriate change for your table.

    WITH BaseData AS (

    SELECT

    person_id,

    seq_no,

    created_timestamp,

    ROW_NUMBER() OVER (PARTITION...

  • RE: Change Tracking Increment Speed Challenge!

    I realize you posted quite a bit of information above. I was wondering if you might consider writing this as an article. You can expand on some of...

  • RE: Query Help

    WayneS (6/13/2012)


    Lynn Pettis (6/13/2012)


    WayneS (6/13/2012)


    Gotta love it when my messed up solution (unused cte) actually worked and solved it.

    ... Actually, I just plain forgot to remove it. I think...

  • RE: Query Help

    WayneS (6/13/2012)


    Gotta love it when my messed up solution (unused cte) actually worked and solved it.

    ... Actually, I just plain forgot to remove it. I think they call that...

  • RE: Query Help

    SQLKnowItAll (6/13/2012)


    Lynn Pettis (6/13/2012)


    SQLKnowItAll (6/13/2012)


    Run this:UPDATE sample SET tech_mode_id = 6 WHERE ID = 3

    Then tell me if your code still works. Not defending mine because I know it...

  • RE: Query Help

    Jared and Wayne,

    Do you notice that cte3 isn't even used in the final select? The final select is using cte2.

  • RE: Query Help

    SQLKnowItAll (6/13/2012)


    Run this:UPDATE sample SET tech_mode_id = 6 WHERE ID = 3

    Then tell me if your code still works. Not defending mine because I know it is a mess......

  • RE: Separate field based on \ character

    The following will also work:

    declare @TestString varchar(32) = 'servername\instance';

    select

    left(@TestString,charindex('\', @TestString) - 1),

    right(@TestString, len(@TestString) - charindex('\', @TestString));

  • RE: Query Help

    SQLKnowItAll (6/13/2012)


    WayneS (6/13/2012)


    This seems like it works:

    WITH SAMPLE (REFERENCE_ID,TECH_MODE_ID,BEGIN_TIME,END_TIME) AS

    (

    SELECT 1, 6, CONVERT(DATETIME,'2012-05-03 20:29:22'),CONVERT(DATETIME,'2012-05-03 20:29:52') UNION ALL

    SELECT 1, 5, '2012-05-03 20:29:53','2012-05-03 20:29:55' UNION ALL

    SELECT 1, 5, '2012-05-03 20:29:56','2012-05-03 20:30:03' UNION...

  • RE: Datetime and sp_executesql Issue

    RovanSQL (6/13/2012)


    Here's part of code i've been trying to run in a procedure, cursor is already defined:

    OPEN @form_dates

    FETCH NEXT FROM @form_dates INTO @cid, @regdate, @compdate

    /* PRINT @regdate

    PRINT @compdate...

  • RE: Query Help

    Nagaram (6/13/2012)


    The input data always consistent .

    begin_time having incremental date also end_time having incremental date.

    I need to group the Consecutive TECH_MODE records by selecting MIN(BEGIN_TIME) , MAX(END_TIME)

    --...

  • RE: Query Help

    Nagaram (6/13/2012)


    Lynn Pettis (6/13/2012)


    Nagaram (6/13/2012)


    I am not sure on which rank function needs to be apply and where to apply to get above RANK .

    In my sample data TECH_MODE...

  • RE: Date Only from Date and Time

    440692 I am just a number (6/13/2012)


    @Lynn

    I absolutely agree,

    but (there had to be one didn't there 🙂 )

    The OP did ask about how to concatenating the values back

    And we...

  • RE: Query Help

    Nagaram (6/13/2012)


    thanks for suggesting rank function ..

    I know about this..

    But my problem is

    -----------------------------------------------------

    Looking at the following two records:

    2 1 5 2012-05-03 20:29:53.000 2012-05-03 20:29:55.000 2

    3 1 5 2012-05-03 20:29:56.000 2012-05-03...

Viewing 15 posts - 11,326 through 11,340 (of 26,486 total)