Forum Replies Created

Viewing 15 posts - 27,466 through 27,480 (of 49,552 total)

  • RE: Proc execution time went from 45 secs to 90 minutes overnight.

    Very likely the lack of stats on the table variable, combined with a change in data distribution in the other tables. How many rows are you putting into that table...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Read Uncommitted Vs NOlock

    Happy with all the effects of read uncommitted?

    See - http://sqlblog.com/blogs/andrew_kelly/archive/2009/04/10/how-dirty-are-your-reads.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Proc execution time went from 45 secs to 90 minutes overnight.

    Gagne (3/9/2011)


    My understanding however is that these are reset whenever SQL Server starts up, am I right ?

    Nope

    I also don't quite understand what you mean about stale statistics,...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: getting the recovery model

    SQL 2000 doesn't have sys.databases, it's new in SQL 2005.

    DatabasePropertyEx has it (function), see Books Online for details.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Are the posted questions getting worse?

    Craig Farrell (3/9/2011)


    Ah, that explains a few things. I'd wondered who'd pissed in your cheerios yesterday, and was just glad it wasn't me. 😉

    Oh, I didn't think it...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Condition in Where clause query

    pwalter83 (3/9/2011)


    Thanks a lot for your answers but would it be possible to convert your solution in a way that they can be included in the WHERE clause section ?

    Why?

    I...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Log shipping in SQL Server 2008 and 2008 R2

    Yes. It works, but it's up-version only.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Condition in Where clause query

    Rough guess...

    SELECT DISTINCT Item INTO #Trades FROM dbo.Split(@trades,',');

    SELECT ....

    FROM ....

    INNER JOIN #Trades t ON t.Item = CASE WHEN MG_BOOKING.Trade IS NOT NULL THEN MG_BOOKING.Trade ELSE MGS_CurrentReportingVessels.Trade END

    AND (MG_BOOKING.Trade IS NULL...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Calculating percentage issue

    Untested...

    WITH diagnostic(numerator, denominator)

    AS (SELECT CONVERT(numeric(9,3), (SELECT COUNT(DISTINCT encounter) AS numerator

    ...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Delete trigger to catch every row

    Then that trigger is not correct....

    Maybe this

    ALTER TRIGGER [dbo].[articlecount]

    ON [dbo].[orderitem]

    AFTER INSERT

    AS

    SET NOCOUNT ON;

    UPDATE Artiklar

    SET [Antalkvar] = Antalkvar...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Condition in Where clause query

    Can you at least post the definitions of the tables that are involved in this query - MG_BOOKING and MG_BILL (create table statement)? Data types is what I'm most interested...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Delete trigger to catch every row

    Pleasure. Just confirm one thing please

    What needs to happen if the same artikelnr is inserted multiple times in one batch? Subtract 1 or subtract the total number of times its...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Selecting the dates from two tabl and inserting into a temporay table

    Does this correctly describe the results you want back? If not, what's wrong?

    '1','Joe','XXX','2011-03-01'

    '1','Joe','XXX','2011-03-01'

    '1','Joe','XXX','2011-02-26'

    '2','James','ZZZ','2011-03-02'

    '2','James','ZZZ','2011-03-08'

    '2','James','ZZZ','2011-03-04'

    '3','Raj','QQQ','2011-03-03'

    '3','Raj','QQQ','2011-03-06'

    '4','RO','WWW','2011-03-05'

    '4','RO','WWW','2011-03-05'

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Selecting the dates from two tabl and inserting into a temporay table

    Not sure if I'm following 100%... Just the dates from Table B? Dates and fetch the rest of the employee data from A? If so will there only be one...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Are the posted questions getting worse?

    *sigh* I know I'm a little short tempered due to lingering jetlag (first time I've still been struggling to sleep 3 days later), but I really didn't need three replies...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 27,466 through 27,480 (of 49,552 total)