Forum Replies Created

Viewing 15 posts - 91 through 105 (of 254 total)

  • RE: Locking Question

    Also consider that an index may have been altered, added, or deleted deliberately or accidentally. Also, statistics could have been updated and actually backfired causing SQL Server to guess poorly...

  • RE: Improving delete performance.

    The only other thing I can come up with right now is to turn what might be a sequential process into a set based process. If you are generating a...

  • RE: Recent Dates Query

    SELECT PMT1.* FROM PaymentTable PMT1 WHERE PMT1.Date = ( SELECT MAX(PMT2.Date) FROM PaymentTable PMT2 WHERE PMT2.AccountNum = PMT1.AccountNum )

     

  • RE: Count day pr mont, year

    The SUM and COUNT are counting all cars for that month for ALL departments. The following two parts need to have another condition added to them.

    SELECT SUM( AntDays ) FROM...

  • RE: Count day pr mont, year

    Sorry about that. I made a copy/paste error. In the newest INSERT the "GjelderFra" needed to be "MonthsTable.TheMonth" in the big case statement. The following version should work. Alternatively you...

  • RE: Count day pr mont, year

    The new insert goes after the original insert. It is intended to fill the gaps that are left by the primary insert. The latest error you got was because you left...

  • RE: Count day pr mont, year

    Good. I think we are almost done now. I briefly mentioned a solution to this earlier on. I will provide better detail this...

  • RE: Count day pr mont, year

    Sorry about that. The "ALTER TABLE #Months" line was something I started and then decided against. I was supposed to delete it but I forgot to. You should be fine.

  • RE: Count day pr mont, year

    The counts say that the tables are fine. I notice nothing wrong with your SQL related to 2004 being omitted. I have two unrelated comments, though. First, you should avoid SELECT...

  • RE: Count day pr mont, year

    This forum editor converted part of my post into a face graphic as below.

    CREATE NONCLUSTERED INDEX IX_#DataRows ON #DataRows 

     (

     MonthGroup, SiOppForsikringFra

      ON [PRIMARY]

    When you look...

  • RE: PK or Composite Key question...

    I'm not sure I understand the relationship requirement. You could simply make a primary key of all three columns. Therefore, so long as any one differs you are allowed a...

  • RE: PRimary key & Performance dilemma!!

    David's approach is by my understanding the more conventional way to maintain a many-to-many relationship. It's main advantage over your two solutions is that if you re-use model names a lot or...

  • RE: SQL Newbie --> How to calculate disk space requirements (table sizes) ???

    The easy one first. For char and varchar fields, the length = number of bytes (almost). For nchar and nvarchar the length = 1/2 number of bytes because each character...

  • RE: SQL Server hosting

    I've never been in the market for a web hoster, but there was an article posted here recently about a review of MyLittleAdmin. It is marketed towards hosters and has...

  • RE: Count day pr mont, year

    I didn't notice you reported the counts at the end of your post a couple posts back. 13 seems really small considering you mentioned there are over 15000 cars. Were those...

Viewing 15 posts - 91 through 105 (of 254 total)