Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 MSDE (2000)
 Getting started

Author  Topic 

SqlFriend
Starting Member

26 Posts

Posted - 2004-08-17 : 06:06:12

This is a little tutorial on how to get started with MSDE. I hope to write a few of them on different aspects of SQL Server (and if possible, get them linked off some of the support pages of this site once they have been improved from positive criticism from people like you).

MSDE is a free version of SQL Server 2000 which they distribute in the hopes you will use it, and then eventually upgrade it to a paying version once your application hits the big time.

However, while your application has 25 concurrent users or less, you reap the rewards of decades of SQL server development.

This link will take you to the Microsoft SQL Server MSDE home page:

http://www.microsoft.com/sql/msde/default.asp

(If that link doesn't work, try going to google, and type in MSDE, you should be able to find it quickly.)

Look over this page and try the links to get a feel for the site. Then when you are ready to take the plunge click on "Downloads" over on the left.

On this page choose the latest version of MSDE listed there (at the time of this writing it is MSDE 2000 Release A). Clicking on this link almost gets you to the download page! Now, on the right side of the screen, chose the language "English" from the drop down that says "Select language" and then hit "Go".

Scroll down to the bottom of this page- there finally is the download link.

At the time of this writing it is MSDE2000A.exe. Click that link, and choose "Save it to disk". I put all of my downloads into a folder off the c: drive called "Downloads". It will download nicely down to your hard drive.

When it is completed, browse to the place where you downloaded it, and install it. It will prompt you as to the location where it should go- it is NOT installing the SQL server yet, it is installing the installer. Go figure.

Therefore, it doesn't matter too much where it goes, it defaults to c:/MSDERelA.

It uncompresses into this all of the installation materials. We are going to run the actual installation from the command prompt, so we can put some information in as command line parameters. To get to the command prompt, go to the start menu, choose "run", and type in

"cmd" for the program to run. A black box appears for commands. Type in "cd .." until you get to the root, and

then type "cd MSDERelA"

First, check out the options for setup by typing

setup.exe /?

This shows you the command line parameters. You want to run the setup with two command line parameters- the password for the administrator, and the security mode, which means if it will use Windows NT system permissions or use vanilla SQL username and passwords. Use vanilla SQL security checking unless you want to spend some effort getting familiar with Microsofts NT permission structure. Choose your password, which will be denoted as 'password' from here on out.

Start the setup with

setup.exe SAPWD="password" SECURITYMODE=SQL

Now SQLServer will install itself, and ask to reboot your computer to be sure anything important you are working on otherwise gets erased. Let it choose the default directories which will make it easy to find where everything is placed.

To get SQLServer to work, you have to run the server itself, and a program to run commands. Both have been installed.

In this command line prompt, browse to the SQLServer executable directory
cd ..
cd Program Files
cd Microsoft SQL Server
cd MSSQL
cd Binn

Then run SqlServer by typing in

sqlserver.exe

Congratulations! You are running SQL server!

Now open ANOTHER command window (use the start menu to run "cmd")

Again, browse to the SQLServer executable directory
cd .. (until you reach the c: by itself)
cd Program Files
cd Microsoft SQL Server
cd MSSQL
cd Binn

Now you are going to run osql.exe- this program allows you to run Transact SQL

statements. Try running

osql /?

To see all of the command line arguments. We are going to log in as system administrator, using the password you created above. So type in

osql -U sa -P password

It will bring up "1>" if you are successful. This is the working area where you will create Transact SQL statements. It will not "run" any of your statements until you give it a "GO" command. Lets create a database, make a table for it, and populate it. Type in

CREATE DATABASE Trial
GO

It should come back telling you about the new database Trial. Now, you will tell it that all future statements will be against this new database.

USE Trial
GO

Now we create a table

CREATE TABLE tblString (line VARCHAR(30))
INSERT INTO tblString ('alpha')
GO

And look at the values in it

SELECT * FROM tblString
GO

You have done it! Now you can see how to interact with Transact-SQL. Feel free to add as many tables and columns as you like. To get rid of that table, type in

DROP TABLE tblString
GO

And finally, to exit the program, type in

EXIT

Congratulations! You have successfully installed SQL Server, created a database, and utilized it.

To learn more about OSQL.exe read this article

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q325003

Kristen
Test

22859 Posts

Posted - 2004-08-17 : 07:54:10
Useful info SqlFriend

Suggest you change:
cd ..
cd Program Files
cd Microsoft SQL Server
cd MSSQL
cd Binn

to

cd /d "C:\Program Files\Microsoft SQL Server\MSSQL\Binn"

Likewise for the other CD command

I would also encourage the installation of MSDE to store its databases somewhere OTHER than Program Files (but I don't know how to do that at Install Time)

Knowing how to apply a Service Pack would be good too. And to set up a Maintenance Plan Backup without EM tools available (probably better to use that than a home grown backup, unless that's well thought through to run completed unattended, but I might get some heat here for saying that!)

Kristen
Go to Top of Page

astralis
Yak Posting Veteran

62 Posts

Posted - 2004-09-02 : 04:43:46
SQLFriend,

I got to this part:

In this command line prompt, browse to the SQLServer executable directory
cd ..
cd Program Files
cd Microsoft SQL Server
cd MSSQL
cd Binn

Then run SqlServer by typing in

sqlserver.exe

Congratulations! You are running SQL server!

When I typed it in, I got this error message:
'sqlserver.exe' is not recognized as an internal or external command, operable program, or batch file.

Any ideas what's going on here?
Go to Top of Page

astralis
Yak Posting Veteran

62 Posts

Posted - 2004-09-03 : 01:11:52
Anyone?
Go to Top of Page

sbt1
Yak Posting Veteran

89 Posts

Posted - 2004-09-03 : 07:53:16
You don't "run" MSDE. It's a service, so you need to either start the mssqlserver service from the Services admin utilites, or use the SQL Server service manager that installs with MSDE.
Go to Top of Page

NatPan
Starting Member

2 Posts

Posted - 2005-02-09 : 12:04:40
Hi SqlFriend,

Thanks for your tutorial below. It's very useful for the new user. I have a few problems with MSDE installation. Please help if you know the answer,

1) I have set up the server with the specific instance name "instance_natpan". But when I run the server with sqlservr.exe, it shows the error msg " SQL server couldn't find the default instanc server (MSSQLSERVER). Please specify the existing instance name on the invocation of sqlservr.exe".

Do you know how to run the server with specific instance name in command prompt?

2) Another problem is I am using below command in cmd to create the tables in the database using the .sql file.

isqlw -S Myserver -d database -E -i input.sql -o output.txt -FU

This command is stated in MSDN library. But it is unable to create the tables and showing error.

Can you help me how to give command to do query using .sql file?

Thank you so much in advance and hope you can help me.









quote:
Originally posted by SqlFriend


This is a little tutorial on how to get started with MSDE. I hope to write a few of them on different aspects of SQL Server (and if possible, get them linked off some of the support pages of this site once they have been improved from positive criticism from people like you).

MSDE is a free version of SQL Server 2000 which they distribute in the hopes you will use it, and then eventually upgrade it to a paying version once your application hits the big time.

However, while your application has 25 concurrent users or less, you reap the rewards of decades of SQL server development.

This link will take you to the Microsoft SQL Server MSDE home page:

http://www.microsoft.com/sql/msde/default.asp

(If that link doesn't work, try going to google, and type in MSDE, you should be able to find it quickly.)

Look over this page and try the links to get a feel for the site. Then when you are ready to take the plunge click on "Downloads" over on the left.

On this page choose the latest version of MSDE listed there (at the time of this writing it is MSDE 2000 Release A). Clicking on this link almost gets you to the download page! Now, on the right side of the screen, chose the language "English" from the drop down that says "Select language" and then hit "Go".

Scroll down to the bottom of this page- there finally is the download link.

At the time of this writing it is MSDE2000A.exe. Click that link, and choose "Save it to disk". I put all of my downloads into a folder off the c: drive called "Downloads". It will download nicely down to your hard drive.

When it is completed, browse to the place where you downloaded it, and install it. It will prompt you as to the location where it should go- it is NOT installing the SQL server yet, it is installing the installer. Go figure.

Therefore, it doesn't matter too much where it goes, it defaults to c:/MSDERelA.

It uncompresses into this all of the installation materials. We are going to run the actual installation from the command prompt, so we can put some information in as command line parameters. To get to the command prompt, go to the start menu, choose "run", and type in

"cmd" for the program to run. A black box appears for commands. Type in "cd .." until you get to the root, and

then type "cd MSDERelA"

First, check out the options for setup by typing

setup.exe /?

This shows you the command line parameters. You want to run the setup with two command line parameters- the password for the administrator, and the security mode, which means if it will use Windows NT system permissions or use vanilla SQL username and passwords. Use vanilla SQL security checking unless you want to spend some effort getting familiar with Microsofts NT permission structure. Choose your password, which will be denoted as 'password' from here on out.

Start the setup with

setup.exe SAPWD="password" SECURITYMODE=SQL

Now SQLServer will install itself, and ask to reboot your computer to be sure anything important you are working on otherwise gets erased. Let it choose the default directories which will make it easy to find where everything is placed.

To get SQLServer to work, you have to run the server itself, and a program to run commands. Both have been installed.

In this command line prompt, browse to the SQLServer executable directory
cd ..
cd Program Files
cd Microsoft SQL Server
cd MSSQL
cd Binn

Then run SqlServer by typing in

sqlserver.exe

Congratulations! You are running SQL server!

Now open ANOTHER command window (use the start menu to run "cmd")

Again, browse to the SQLServer executable directory
cd .. (until you reach the c: by itself)
cd Program Files
cd Microsoft SQL Server
cd MSSQL
cd Binn

Now you are going to run osql.exe- this program allows you to run Transact SQL

statements. Try running

osql /?

To see all of the command line arguments. We are going to log in as system administrator, using the password you created above. So type in

osql -U sa -P password

It will bring up "1>" if you are successful. This is the working area where you will create Transact SQL statements. It will not "run" any of your statements until you give it a "GO" command. Lets create a database, make a table for it, and populate it. Type in

CREATE DATABASE Trial
GO

It should come back telling you about the new database Trial. Now, you will tell it that all future statements will be against this new database.

USE Trial
GO

Now we create a table

CREATE TABLE tblString (line VARCHAR(30))
INSERT INTO tblString ('alpha')
GO

And look at the values in it

SELECT * FROM tblString
GO

You have done it! Now you can see how to interact with Transact-SQL. Feel free to add as many tables and columns as you like. To get rid of that table, type in

DROP TABLE tblString
GO

And finally, to exit the program, type in

EXIT

Congratulations! You have successfully installed SQL Server, created a database, and utilized it.

To learn more about OSQL.exe read this article

http://support.microsoft.com/default.aspx?scid=kb;EN-US;q325003

Go to Top of Page

Andraax
Aged Yak Warrior

790 Posts

Posted - 2005-02-09 : 16:56:41
Hi NatPan.

1) I suggest you use the services screen to start the server. You can find it by right clicking "my computer" and then choosing "manage". If correctly installed, there should be a service called something like MSSQLSERVER$instance_natpan (or something like that). That service is the one to start.

If you have to use sqlservr.exe to start, you have to use the /S switch. Example: sqlservr.exe /Sinstance_natpan

2) What error message do you get? As I recall, isql/w (query analyzer) is not included with MSDE. You have to use OSQL instead (the command line tool).

/Andraax
Go to Top of Page

NatPan
Starting Member

2 Posts

Posted - 2005-02-14 : 01:27:17
Hi Andraax,

Thanks for your greate help. Now i can automate the starting of SQL server from cmd. Thanks again.
Go to Top of Page
   

- Advertisement -