Forum Replies Created

Viewing 15 posts - 1,681 through 1,695 (of 6,394 total)

  • RE: concatenation of two columns as single

    How I have got around the problem in the past.

    ;with cte as

    (select

    convert(varchar,run_date) as rundate,

    right('000000'+convert(varchar,run_time),6) as runtime

    from msdb.dbo.sysjobhistory

    )

    select convert(datetime,rundate+' '+left(runtime,2)+':'+left(right(runtime,4),2)+':'+right(runtime,2))

    from cte

  • RE: Last N Group with Top n for each Group

    Sorry I had PeriodID in mind when writing the script and that it was an auto-increment number with no gaps, you are correct that with gaps the query doesn't work...

  • RE: The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo' despite Trustworthy Set to ON

    So its down to cross database issues.

    Are both DB's owned by the same account?

  • RE: Log addind

    Log files are sequential, thus only one log file is used at a time.

    The only time I would recommend adding a second LDF file is when the first is full...

  • RE: Db Mail not seemingly working

    Was there anything in the sysmail_event_log table detailing the failures?

  • RE: The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo' despite Trustworthy Set to ON

    Can you run SSMS as the proxy user and try running the select?

    Are there no deny's at all on MSDB.dbo.sysjobs?

    The proxy account inst part of any groups which have deny...

  • RE: The SELECT permission was denied on the object 'sysjobs', database 'msdb', schema 'dbo' despite Trustworthy Set to ON

    Check for an explicit deny right on the sysjobs table

  • RE: Help with persmissions and server roles

    Are you bothered about the AD group modifying (alter, drop, restore) any of the DB's on the instance?

    If not give them dbcreator, this will allow them to create, alter, drop,...

  • RE: Today's Random Word!

    eccentricDBA (11/18/2015)


    crookj (11/18/2015)


    anthony.green (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    djj (11/18/2015)


    Ed Wagner (11/17/2015)


    djj (11/17/2015)


    DonlSimpson (11/17/2015)


    djj (11/17/2015)


    Ed Wagner (11/17/2015)


    crookj (11/17/2015)


    Blizzard (Snow Day)

    Snow Thrower

    Shovel

    Dig

    Work

    Home

    Family

    Fortunes

    Savings

    Interest

    Investment

    Return

    Gosub 🙂

    BASIC

    Visual

  • RE: Password Change

    Personally I would still make the change via config manager. Just for my own piece of mind knowing its been done that way.

    Not saying it cant be done via...

  • RE: String Function

    heres my quick take on it

    create table #test (testdata varchar(50))

    insert into #test values

    ('Consumer|3860701|1442421'),

    ('something|12345|67890')

    ;with cte as

    (select * from #test

    cross apply dbo.DelimitedSplit8K(testdata,'|')

    )

    select t1.item, t2.item from cte t1

    inner join cte t2

    on t1.testdata =...

  • RE: Last N Group with Top n for each Group

    serg-52 (11/18/2015)


    Antony,

    and periodid >= (select max(dr)-3 from cte)

    may lead to too much periods returned. Consider periods

    (3,4,5,6,7). Then max(dr) -3 ==2.

    MAX(DR) = 7

    7 - 3 = 4

    >=4 =...

  • RE: Last N Group with Top n for each Group

    Yeah I had a typo, the script should work now, just retested it.

  • RE: Today's Random Word!

    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    Ed Wagner (11/18/2015)


    anthony.green (11/18/2015)


    djj (11/18/2015)


    Ed Wagner (11/17/2015)


    djj (11/17/2015)


    DonlSimpson (11/17/2015)


    djj (11/17/2015)


    Ed Wagner (11/17/2015)


    crookj (11/17/2015)


    Blizzard (Snow Day)

    Snow Thrower

    Shovel

    Dig

    Work

    Home

    Family

    Fortunes

    Savings

    Interest

    Investment

    Return

  • RE: Last N Group with Top n for each Group

    OK, this is my take on the problem then

    create table #test_period (periodid int, customerid int, closebalance decimal (18,2))

    insert into #test_period values

    (1,1,10.82),

    (1,2,14.67),

    (1,3,15.90),

    (1,4,12345.90),

    (1,5,545.86),

    (1,6,8456.05),

    (1,7,549851.00),

    (1,8,564891.02),

    (1,9,7845.09),

    (1,10,12.23),

    (1,11,74.15),

    (1,12,98.45),

    (1,13,98.99),

    (1,14,931.25),

    (2,1,54.44),

    (2,2,518.54),

    (2,3,8253.25),

    (2,4,455.90),

    (2,5,5575.86),

    (2,6,556.05),

    (2,7,851.00),

    (2,8,891.02),

    (2,9,75.09),

    (2,10,1.23),

    (2,11,7.15),

    (2,12,9.45),

    (2,13,9.99),

    (2,14,91.25),

    (3,1,118.82),

    (3,2,154.67),

    (3,3,155.90),

    (3,4,1345.90),

    (3,5,45.86),

    (3,6,856.05),

    (3,7,59851.00),

    (3,8,56891.02),

    (3,9,785.09),

    (3,10,2.23),

    (3,11,7.15),

    (3,12,8.45),

    (3,13,988.99),

    (3,14,31.25),

    (4,1,174.82),

    (4,2,174.67),

    (4,3,175.90),

    (4,4,127345.90),

    (4,5,5745.86),

    (4,6,87456.05),

    (4,7,5851.00),

    (4,8,891.02),

    (4,9,75.09),

    (4,10,742.23),

    (4,11,7444.15),

    (4,12,9858.45),

    (4,13,99698.99),

    (4,14,95231.25),

    (5,1,1052.82),

    (5,2,12544.67),

    (5,3,15245.90),

    (5,4,1254345.90),

    (5,5,52445.86),

    (5,6,84422456.05),

    (5,7,5449851.00),

    (5,8,56424891.02),

    (5,9,784245.09),

    (5,10,4212.23),

    (5,11,224274.15),

    (5,12,922458.45),

    (5,13,24532.99),

    (5,14,2545.25)

    select * from #test_period

    --Assuming you don't have any gaps in...

Viewing 15 posts - 1,681 through 1,695 (of 6,394 total)