SQL Server v4.2 create database syntax error

  • I'm using SQL Server for Windows NT 4.21a (Intel X86)

    Aug 24 1994 19:06:24

    Copyright (c) 1988-1994 Microsoft Corporation; Copyright Sybase, Inc 1987-1994

    I know, I know. I'm trying to rescue data from a very old system. This step is creating a database I need to do that.

    In ISQL/w I execute...

    USE MASTER

    CREATE DATABASE epic_names

    ON PRIMARY (NAME = endat, FILENAME = 'd:\sql_updts\en.mdf', SIZE = 20MB, MAXSIZE = 20MB)

    ...I get the error message...

    Msg 102, Level 15, State 1

    Incorrect syntax near 'NAME'.

    Does anyone have any idea what I'm doing wrong? Thanks for your help.

    - Ed Lipchus

  • Did you try to enclose endat with single quotes? Just guess.

  • Yes I did. It doesn't like that. New error...

    Msg 102, Level 15, State 1

    Incorrect syntax near 'NAME'.

    Thanks

    - Ed L

  • Have you tried leaving "ON PRIMARY" out?

    --------------------------------------------------------------------------
    A little knowledge is a dangerous thing (Alexander Pope)
    In order for us to help you as efficiently as possible, please read this before posting (courtesy of Jeff Moden)[/url]

  • The syntax you are using looks like SQL Server 7 or above. Different syntax was used in older versions, but I do not know the details. Hopefully someone will post a response.

    Alternatively try Google. A search for "SQL Server 4.2" turned up a few posts from people who worked on this product. You may find contact details on one of these for someone who is able to help.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • What it the data you have? Is it an old backup or do you have the data files?

    Hve you tried restoring / attaching them to a 2K, 2K5 or 2K8 instance? They have upgrade routines for older versions - perhaps as far back as 4.2?

    ed

  • You're right. That's the frustrating part. This is a 14 y.o database engine and I can't find _any_ documentation on it. Even MS Knowledgebase doesn't go back that far. Grrrr. Alas, I'm stuck with it. I.m trying to clear up data in preparation for moving to a newer system.

    Thanks.

  • Google can find you instructions for upgrading from SQL 6.5 to SQL 7, which was a major change in file format. I would be surprised if anything above SQL 7 can cope with a 6.5 or previous backup, but it is worth trying.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Alas, I can't do that. SS4.2 was bundled by the vendor with their product. I'm doing this to clear up data prior to moving to a more modern system.

  • You first need to create 'devices' with the diskinit command.

    disk init

    name = 'data_device',

    physname = "d:\devices\userdata.dat",

    size = 5120 --> size is in 2k pages, so this is 10 Mb

    disk init

    name = 'log_device',

    physname = "d:\devices\userlog.dat",

    size = 512 --> size is in 2k pages, so this is 1 Mb

    Next you can then use a create database command.

    create database userdatabase

    on data_dev=10 --> size is in Mb here

    log on log_dev=1 --> size is in Mb her too

    I might have 4.21a or 6.0 installation media at home - I will check for BOL for you if you like.

    However, v4.21 was actually Sybase that MS licensed - it is equivalent to Sybase v4.9.2. I would suggest in the interim that you check out Sybase.com and Sybooks (their BOL) for the 'diskninit' command and 'create database' command syntax since they still support device file usage.

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • oops ... I think that Sybase uses physname on diskinit

    and MS wants to use phyname on diskinit instead ... go figure

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • boy - you never realize how much you have forgotten - v4.21a was so long ago ...

    is it physname or phyname ... just cannot remember ...

    LOG ON or just ON ... boy I'm really scratching my head now ...

    diskinit alse needs vdevno=n, where n is a unique number. but this number maximum is defined by sp_configure, I think it is 'maximum devices' or something like that. I believe that the 'maximum' is actually the maximum minus one. When you set this number via sp-configure you must restart SQL Server. Lets see what else ...

    Back to devices, make 'em bigger than you need. Once you create them you need not use all of the space on the create database - save a bit. This is because in this version you cannot 'resize' devices - you gotta add new ones. It also makes altering the database to make it bigger a pain because of something called segmentation - jeeze MS has come a long way in making things easier !

    Hope this 'crazy' brain dump helps !

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • You could try looking for old sybase documentation. Sometimes with 4.2 and the older versions the sybase doc was a better place to go than the Microsoft documentation.

    I may have an old 4.2 manual on the shelf at home, I will check tonight.

  • rudy komacsar (3/18/2009)


    boy - you never realize how much you have forgotten - v4.21a was so long ago ...

    Geez Rudy, slowly things are coming back to mind. Devices! Those were the good old days, when DBAs were still DBAs and network engineers at the same time 😉

    To the OP, I asked a colleague who was also around at that time what he remembers. Will get back to you if he does come up with something. Will also check if I can find some docs back at the office (will have to wait till Friday though). Or of course I may find an install of 6.5 which should be able to restore that DB. That install was still on floppies if I remember correctly, so it can't be too big to get it to you if you need it. Guess MS wouldn't mind from a licensing point of view?

    Greets,

    Jan

    --------------------------------------------------------------------------
    A little knowledge is a dangerous thing (Alexander Pope)
    In order for us to help you as efficiently as possible, please read this before posting (courtesy of Jeff Moden)[/url]

  • I know I have 6.0 CD at home - I may even have a v4.21 CD with the 3 floppies for the client tools - I'll let you know tomorrow for sure - if you need them I can upload them somewhere for you to pick up - I would take the client tools at a minimum since it has BOL !

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic. Login to reply