How To

How to test an installation of SQL Server 2000 (Command Prompt)

To test the installation

  1. Start Microsoft® SQL Server™ 2000 by entering from a command prompt:

    For the default instance, use:

    net start mssqlserver
    

    For a named instance, include the instance name, for example:

    net start MSSQL$Instance1
    
  2. Connect to SQL Server by entering:

    For the default instance, use:

    osql /Usa /P <administrator password>
    

    For a named instance, include both the server and instance name, for example:

    osql /Usa /P /S Machine1\Instance1
    

    When osql connects, this osql prompt appears:

    1>
    

    If osql cannot connect, an ODBC error is returned.

  3. Enter a simple query, such as:
    SELECT @@SERVERNAME
    GO
    

    The osql utility returns the server name:

    1> SELECT @@SERVERNAME
    2> GO
    -------------------------------
    WOLFHOUND
    
    (1 row affected)
    1>
    
  4. Verify that you have checked a SQL Server 2000 server by entering:
    SELECT @@VERSION
    GO
    

    The osql utility returns the version information.

  5. Quit the osql utility by entering:
    Exit