Forum Replies Created

Viewing 15 posts - 9,196 through 9,210 (of 26,490 total)

  • RE: Problem in Configuring Mirroring

    As it looks like your servers are not part of the same domain and are using local service accounts, you may need to look at using certificates to configure the...

  • RE: Restore database without secondary datafile (.ndf)?

    No. You need to restore all the files of the database.

  • RE: Issues with data format

    kk.86manu (12/7/2012)


    Thanks for your reply

    I just have one more clarification

    IF '12/07/2012'<'12/01/2013'

    For the mentioned condition the first value is the same and second value is greater and again the condition...

  • RE: How can this be done without a cursor?

    Peter Pirker (12/7/2012)


    Hi Lynn,

    It looks like you got it right the first time - although I'm not sure I fully understand it (yet).

    Unfortunately i haven't had time to provide you...

  • RE: How can this be done without a cursor?

    Unfortunately you haven't been much help. You still haven't provided us with the information I requested which just makes it harder to try and provide you with an answer...

  • RE: Update Gaps

    Here is another solution to the problem:

    CREATE TABLE dbo.UpdateGaps(

    MachineID int NOT NULL,

    RecordedDate datetime NOT NULL,

    Pressure float NULL,

    CONSTRAINT PK_UpdateGaps PRIMARY KEY...

  • RE: How can this be done without a cursor?

    What would help is if you could post the DDL (CREATE TABLE statement) for the tables involved, the sample data as a series of INSERT INTO statements to populate the...

  • RE: Query to find the start day of the week as Monday

    Jeff Moden (12/4/2012)


    Lynn Pettis (12/4/2012)


    Jeff Moden (12/4/2012)


    Then substitute a 0 for Michael's -53690. 😀

    That, not withstanding, it's always the "edge cases" that cause panic stricken calls at 3 in the...

  • RE: database log file

    It shouldn't since you can't run insert, update, or delete statements. In addition you can't update the statistics or reorganize or rebuild indexes.

  • RE: Query to find the start day of the week as Monday

    sgmunson (12/4/2012)


    Lynn Pettis (12/4/2012)


    Compare:

    DECLARE @date DATE = '20121202';

    SELECT

    CASE WHEN datename(dw,@date) <> 'Sunday' THEN CONVERT(varchar(10), DATEADD(WK, DATEDIFF(WK, 0, @date), 0),

    103) ELSE CONVERT(varchar(10), DATEADD(WK, DATEDIFF(WK, 0, @date), - 7), 103)...

  • RE: Query to find the start day of the week as Monday

    Jeff Moden (12/4/2012)


    Then substitute a 0 for Michael's -53690. 😀

    That, not withstanding, it's always the "edge cases" that cause panic stricken calls at 3 in the morning.

    If I have to...

  • RE: Query to find the start day of the week as Monday

    Michael Valentine Jones (12/4/2012)


    Lynn Pettis (12/4/2012)


    Michael Valentine Jones (12/4/2012)


    select

    a.*,

    Monday = dateadd(dd,(datediff(dd,-53690,a.DATE)/7)*7,-53690)

    from

    ( -- Test Data

    select [Date]= getdate()-2union all

    select [Date]= getdate()-1union all

    select [Date]= getdate()union all

    select [Date]= getdate()+1union all

    select [Date]= getdate()+2union all

    select [Date]=...

  • RE: Query to find the start day of the week as Monday

    sgmunson (12/4/2012)


    Lynn Pettis (12/4/2012)


    Compare:

    DECLARE @date DATE = '20121202';

    SELECT

    CASE WHEN datename(dw,@date) <> 'Sunday' THEN CONVERT(varchar(10), DATEADD(WK, DATEDIFF(WK, 0, @date), 0),

    103) ELSE CONVERT(varchar(10), DATEADD(WK, DATEDIFF(WK, 0, @date), - 7), 103)...

  • RE: Query to find the start day of the week as Monday

    Michael Valentine Jones (12/4/2012)


    select

    a.*,

    Monday = dateadd(dd,(datediff(dd,-53690,a.DATE)/7)*7,-53690)

    from

    ( -- Test Data

    select [Date]= getdate()-2union all

    select [Date]= getdate()-1union all

    select [Date]= getdate()union all

    select [Date]= getdate()+1union all

    select [Date]= getdate()+2union all

    select [Date]= getdate()+3union all

    select [Date]= getdate()+4union all

    select...

  • RE: Query to find the start day of the week as Monday

    sgmunson (12/4/2012)


    How about:

    CASE

    WHEN DATEPART(dw, THE_DATE) = 1 THEN DATEADD(dd, -6, THE_DATE)

    ELSE DATEADD(dd, 0 - (DATEPART(dw, THE_DATE) - 2), THE_DATE)

    END

    where THE_DATE is assumed to be the date field...

    No conditional logic required:

    DECLARE...

Viewing 15 posts - 9,196 through 9,210 (of 26,490 total)