Forum Replies Created

Viewing 15 posts - 11,641 through 11,655 (of 26,486 total)

  • RE: What motivates those of you who answer questions?

    I had already worked with MS SQL Server for about 8 years when I joined SSC and started getting active on this site. OVer the next 5 years I...

  • RE: Improving Delete Query

    Eugene Elutin (5/29/2012)


    Is it one-off data-fix task? If you have no triggers on the table which you need to execute on delete, if it's not referenced by FK relationships and...

  • RE: Improving Delete Query

    TheSQLGuru (5/29/2012)


    Hardy21 (5/29/2012)


    Lynn Pettis - you are right.

    I have just given one option to change the query.

    It will calculate and store filtered records in temp table so during delete, it...

  • RE: Improving Delete Query

    Hardy21 (5/28/2012)


    Try below option:

    create table #TempData

    (GlobalRecodID INT)

    insert into #TempData (GlobalRecodID)

    select GR.GlobalRecodID FROM GlobalRecords AS GR

    LEFT JOIN localRecord AS LR

    ON GR.GlobalRecodID = LR.GlobalRecordID

    WHERE DATEDIFF(day, GR.ModificationDate, getdate()) > 365 and LR.GlobalRecordID IS...

  • RE: Improving Delete Query

    Give this a try, it is written for SQL Server 2000:

    declare @batchsize int;

    set @batchsize = 10000;

    set rowcount 10000;

    while @batchsize > 0

    begin

    delete

    ...

  • RE: Today, Tomorrow, This Week

    anthony.green (5/28/2012)


    --To get 23:59:59 of the current day

    SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE(),120),10)+' 23:59:59.997')

    --To get 00:00:00 of the next day

    SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE()+1,120),10)+' 00:00:00.000')

    --To get 23:59:59 of the next day

    SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE()+1,120),10)+' 23:59:59.997')

    That will do what you...

  • RE: Where are the good Senior Level DBA's?

    JamesMorrison (5/25/2012)


    I always blame Chuck Norris when anything goes wrong. He is unstoppable.

    Chuck Norris was born on May 6th, 1945

    Nazi Germany surrendered on May 7th, 1945.

    Nice joke, but, he was...

  • RE: Logical Operators

    ronmoses (5/24/2012)


    The only reason I had to think about it a while is that I would never combine AND and OR without parentheses, so that fact was a bit dusty...

  • RE: SP sudden slow down - what could be the cause?

    SQL Kiwi (5/25/2012)


    Lynn Pettis (5/25/2012)


    Answering the rhetorical question, when has a thread ever stayed strictly on topic?

    Not as often as it should? At least until the primary question has...

  • RE: SP sudden slow down - what could be the cause?

    SQL Kiwi (5/25/2012)


    Gullimeel (5/25/2012)


    This is simple arithmatic that IO cost + cpu cost is the total operator cost.How optimizer is calculating IO cost or CPU cost that is explained very...

  • RE: SP sudden slow down - what could be the cause?

    Gullimeel (5/25/2012)


    So it isn't necessarily same algorithm used by the Query Optimizer, correct?

    I told the optimizer alogorithm to calculate the cost based on IO and cpu cost..

    How?

  • RE: SP sudden slow down - what could be the cause?

    Gullimeel (5/25/2012)


    Gullimeel (5/25/2012)

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

    Paul.

    In attached screenshot if you will see that the IO cost estimation is 185.2 and CPU estimation cost is around 4.8. Then total subtree cost should have been...

  • RE: SP sudden slow down - what could be the cause?

    Gullimeel (5/25/2012)


    Paul.

    In attached screenshot if you will see that the IO cost estimation is 185.2 and CPU estimation cost is around 4.8. Then total subtree cost should have been around...

  • RE: Database Alert didn't Fire

    Fraggle-805517 (5/24/2012)


    Lynn,

    That sounds interesting. Could you provide more details on the implementation on that.

    Thanks,

    Fraggle

    I can try. I'll have to contact a co-worker there (he actually has my job...

  • RE: Using cursor to change values in a table to a counter

    In addition, if you reread the original post, the modification of the ssn in the table was merely an example. Does this mean that this is actually what the...

Viewing 15 posts - 11,641 through 11,655 (of 26,486 total)