Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10

    Unanswered: TOP not working in SS2K!

    Ok, so this thread has been raised from here...

    Basically if I run this query
    Code:
    SELECT TOP 1 birth_date FROM people ORDER BY birth_date
    --I get this
    Server: Msg 170, Level 15, State 1, Line 1
    Line 1: Incorrect syntax near '1'.
    Has anyone ever come across this problem before?

    I'm running SQL Server 2000

    ~George
    George
    Home | Blog

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Oh that's easy - check you compatability level
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Say what?
    How?

    I <strike>hate</strike> dislike you

    EDIT: "I dislike you right now"
    George
    Home | Blog

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    He he.

    Code:
    
    EXEC dbo.sp_dbcmptlevel my___db
    
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    The current compatibility level is 65.
    *shifty eyes*
    Now what?
    George
    Home | Blog

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Your db is running as a 6.5 version db. This option is actually deprected in SQL 2005. Check out the entry in BoL for sp_dbcmptlevel. I suspect it started out as 6.5, upgraded to 7 then to 2k (or skipped 7).

    In theory it should be 80 however I really wouldn't want to say "whack it up to 80 George" without looking at the code. There could be a lot of unpleasant side effects. Someone else might have some experience of this.

    You could restore a copy and change the level and do some QA.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Yeah, the "techies" don't like people playing around with restores etc.
    With over 300 tables and a rediculous front end to test - it's not worth the hassle really!
    It'd make some queries a lot easier but for now I'll just have to work around it

    I guess you're right - this product was initially developed about 10 years ago - which puts it pre-2000 (duh!).

    Thanks for your estranged and belated help
    George
    Home | Blog

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    estrange - (arouse hostility or indifference in where there had formerly been love, affection, or friendliness)
    http://wordnet.princeton.edu/perl/webwn?s=estranged

    Aw George - what are you saying to me?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    See post #3
    <3
    George
    Home | Blog

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by georgev
    Yeah, the "techies" don't like people playing around with restores etc.
    BTW - you know that playing around with restores is something you should be dong regularly yes? You back up your databases I presume using BACKUP DATABASE... or some maintenance plan I hope. You should practice\ test some restores because you don't want to be looking up the syntax in an emergency and then find your backups have all been failing.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    We take backups daily - but us developers have nothing to do with that (arguably that's a good thing). We have a full DR plan, so not to worry.

    Unfortunately it does mean that I have never backed up nor restored an SQL Server database, so that whole area is a bit of a black spot in my knowledge.

    Basically I'mma just leave the whole top business for this app - it'll be replaced in a year or so anyway. I've always found a way round it so far.
    George
    Home | Blog

  12. #12
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Quote Originally Posted by georgev
    We have a full DR plan, so not to worry.
    Uhm...having a plan does not make you safe. Is anybody doing regular restores for testing and verification?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  13. #13
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    My plan is to use the backup we took last year. I am sure t is still good. Magnetic tape likes to be kept near an MRI machine, doesn't it?

  14. #14
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    Quote Originally Posted by MCrowley
    My plan is to use the backup we took last year. I am sure t is still good. Magnetic tape likes to be kept near an MRI machine, doesn't it?
    I find just a regular furnace works best.

  15. #15
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    I used to work for a company that made magnetic door locks.
    For laughs and giggles one day we saved some data to a floppy disk and then ran it over a 1500 lb magnet a few times. Popped it back in the computer, and it read the data just fine.
    Go figure.
    Not that I would recommend doing this, though.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •