Click here to Skip to main content
Click here to Skip to main content

Hands on how to configure the Microsoft MSDE

By , 14 Nov 2004
 

Introduction

This article describes how to configure the Microsoft MSDE database engine. Below you will find an overview of the topics.

What is MSDE?

MSDE is a limited version of the Microsoft SQL Server. In short, it is the Microsoft SQL Server 2000 database engine without any of the fancy UI tools, and with some limitations in the database size and the number of connections. The MSDE database is free, and can be distributed embedded in your own applications or as a small stand alone SQL server. It is ideal for small websites and small businesses with less than 25 simultaneous users. The database is limited to 2 GB of data storage space, but you can easily upgrade it to a full Microsoft SQL Server without any limitations. Among the choices are, a standard edition or an enterprise edition. An MSDE database is a good and affordable starting point for any business, organization or even home solutions. The database does not have to be installed on the hard drive on the deployment computer, but it could be running from a CD-ROM.

Limitations

There are some limitations to a MSDE database. You don’t get:

  • Failover clustering.
  • Log shipping.
  • Parallel DBCC.
  • Parallel create index.
  • Enhanced read ahead and scan.
  • Indexed views.
  • Federated database server.
  • System area network support (SAN).
  • Graphical DBA, and developer utilities and wizards.
  • Full-text search.
  • Analysis services.
  • OLAP partitions.
  • Partition wizard.
  • Linked OLAP cubes.
  • ROLAP dimension support.
  • HTTP Internet support.
  • Custom rollups.
  • Calculated Cells.
  • Write back to dimensions.
  • Very large dimension support.
  • Actions.
  • Real-time OLAP.
  • Distributed partition cubes.
  • Data mining.
  • English query.

What you get

This is what you get:

  • Maximum number of processors: 2 in NT/Win2000/XP/2003, 1 in Win98/ME.
  • Maximum physical memory: 2 GB.
  • Maximum user connections: 5 before the work load governor will limit the performance.
  • Maximum data storage: 2 GB.
  • Desktop embedded or network access.
  • Leading SQL database performance.
  • It’s free. =:-)

How to install and configure the MSDE

The MSDE can be downloaded from the Microsoft web site for free. Download the archive and uncompress it to a folder on your hard drive. There are four different ways to run the MSDE depending on how you want to access the database. They are all listed below.

You can configure the MSDE in three different ways:

  • Arguments to the setup.exe file.
  • Using the “setup.ini” file.
  • Post reconfiguration.

The four different running modes are:

  • Windows authentication without network access.
  • Windows authentication with network access.
  • Mixed Windows and SQL mode authentication without network access.
  • Mixed Windows and SQL mode authentication with network access.

Please use Windows authentication whenever possible. SQL mode will send the login and the password information over the network in plain text. This means it can be sniffed by intruders or hackers. Windows authentication uses SSPI which you can read more about on these web pages MSDN [1], and MSDN [2]. A default installation will disable the network access and uses the Windows authentication mode.

Before you start the installation of the MSDE, disable Norton Antivirus and the Internet Security Pack. You will enable it after the installation has completed. Norton Antivirus will not let you install the MSDE successfully, when enabled.

In all of our examples, we will be using “password” for the system administrator, and “myinstance” for the database instance.

Arguments to the setup.exe file

You can run configure the MSDE by giving arguments to the setup.exe file on a command prompt.

Windows authentication with network access.

Example 1 (Win access over a network).

In this example, we will be using Win authentication, because we do not want to send the username and password in plain text over the network. Only Windows applications and .NET applications can access the database. The application uses automatically the login name and password on the client computer to login to the MSDE.

C:\...MSDE\>Setup.exe DISABLENETWORKPROTOCOLS=0 
              SAPWD="password "INSTANCENAME="myinstance"

Mixed Windows and SQL mode authentication with network access.

Example 2 (Java and Win access over a network):

In this example, we will be using the mixed mode authentication, because we want to access the database from both Windows applications and Java applications over a network. The username and password will be sent over the network in plain text.

C:\...MSDE\>Setup.exe DISABLENETWORKPROTOCOLS=0 
      SAPWD="password " INSTANCENAME="myinstance" SECURITYMODE=SQL

Mixed Windows and SQL mode authentication without network access.

Example 3 (Local Java and Win access only):

In this example, we will not be granting access from the network. Only local applications can access the database. We will be using mixed mode authentication for Java applications.

C:\...MSDE\>Setup.exe SAPWD="password "INSTANCENAME="myinstance" SECURITYMODE=SQL

Windows authentication without network access

Example 4 (Local Win access only):

In this example, we will not grant network access to the database. We will also only grant Win authentication access. This is the most secure setup, and should be used for embedded MSDE applications.

C:\...MSDE\>Setup.exe SAPWD="password " INSTANCENAME="myinstance"

Using the “setup.ini” file

You will find a file called “setup.ini” in the MSDE folder, if you want to use a pre configured setup file. Please remember that anyone with read access to this file can see the system administrator password if this is an issue. The file looks like this:

[Options]

Here you will enter the configuration arguments.

Mixed Windows and SQL mode authentication with network access.

Example 1 (Java and Win access over a network):

In this example, we will be using mixed mode authentication, because we want to access the database from both Windows applications and Java applications over a network. The username and password will be sent over the network in plain text.

[Options]
DISABLENETWORKPROTOCOLS=0
SAPWD="password "
INSTANCENAME="myinstance"
SECURITYMODE=SQL

To install MSDE, run the “setup.exe” install application.

Windows authentication with network access.

Example 2 (Win access over a network):

In this example, we will be using Win authentication, because we do not want to send the username and password in plain text over the network. Only Windows applications and .NET applications can access the database. The application uses automatically the login name and password on the client computer to login to the MSDE.

[Options]
DISABLENETWORKPROTOCOLS=0
SAPWD="password "
INSTANCENAME="myinstance"

To install MSDE, run the “setup.exe” install application.

Mixed Windows and SQL mode authentication without network access.

Example 3 (Local Java and Win access only):

In this example, we will not be granting access from the network. Only local applications can access the database. We will be using mixed mode authentication for Java applications.

[Options]
SAPWD="password "
INSTANCENAME="myinstance"
SECURITYMODE=SQL

To install MSDE, run the “setup.exe” install application.

Windows authentication without network access

Example 4 (Local Win access only):

In this example, we will not grant network access to the database. We will also only grant Win authentication access. This is the most secure setup, and should be used for embedded MSDE applications.

[Options]
SAPWD="password "
INSTANCENAME="myinstance"

To install MSDE, run the “setup.exe” install application.

Post reconfiguration

It is possible to reconfigure the authentication mode for an already installed instance of the MSDE, through the registry. Stop the database instance in the Control Panel (“Administrative Tools” and “Services”). Open the “regedt32.exe”, and locate the “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\myinstance\MSSQLServer” and the key “LoginMode”. For Windows authentication, set this key to “1”; for SQL authentication, set this key to “0” (or “2”?). Restart the database instance in the Control Panel (“Administrative Tools” and “Services”).

Do you want to change the system administrator (sa user) password?

Login to the MSDE using the osql tool:

Using Win authentication:

C:\> osql –E –S localhost\myinstance
1> use master
2> go
1> exec sp_password @old = null, @new = ‘newpassword’, @loginame = 'sa'
2> go
Password changed.
1>quit

Using SQL authentication:

C:\> osql –U sa –P password –S localhost\myinstance
1> use master
2> go
1> exec sp_password @old = null, @new = ‘newpassword’, @loginame = 'sa'
2> go
Password changed.
1>quit

Configure the server:

Run the SQL Server network utility. Open a command prompt and type:

C:\> svrnetcn.exe

Enable the “Named Pipes” protocol and the “TCP/IP” protocol. Click on “Properties” on the “TCP/IP” protocol. Here, you will configure the default port MSDE will be listening on if you want network access. Default is 1433.

Configure the client:

Run the SQL Server client network utility. Open a command prompt and type:

C:\> cliconfg.exe

Enable the “Named Pipes” and the “TCP/IP” protocols. Click on “Properties” on the “TCP/IP” protocol. Here you configure the port number you found with the “svrnetcn.exe” utility. Default is 1433.

Add an alias for the “Named Pipes” and the “TCP/IP” under the “Alias” box. You will use an alias if you do not want to configure all applications to a specific configuration. The client just accesses the alias, and the client utility will map the request to the right configuration.

Fire it up!

Let’s start the MSDE. Open the Control Panel, the Administrative Tools and the “Services” utility. Find the instance “MSSQL$MYINSTANCE” in the list. Right click it, and choose “Start”. Startup type should be “Automatic”.

How do I determine what version I am running?

OK, the MSDE should now be up and running. Let’s test it. Run the osql tool.

C:\> osql –E –S localhost\myinstance
1: select @@VERSION
2: go
3: quit

8.00.194 - MSDE 2000
8.00.384 - MSDE 2000 SP1
8.00.534 - MSDE 2000 SP2
8.00.760 - MSDE 2000 SP3

Create and delete a database

By default, the MSDE has four databases installed. These databases are:

  • Master – Contains all of the system meta-data, like login accounts, settings, and the location of the database files etc. Files: master.mdf, mastlog.ldf.
  • Tempdb – Contains work tables and temporary storage. All the data in this database will be deleted on disconnect. Files: tempdb.mdf, templog.ldf.
  • Model – This is a model of all databases on the system. It acts as a template for new databases. Files: model.mdl, modellog.ldf.
  • Msdb – Used for the SQL Server Agent to schedule jobs. Files: msdbdata.mdf, msdblog.ldf.

You should not use any of these databases for any application purposes. They are holy land as far as the applications know it. They are out of reach, simple as that. Create a new database to store your application data.

Let us create a database with the name “Books”. First of all, you must login as a system administrator (sa) or as a user with dbcreator privileges. Open the osql administration utility and login as system administrator.

C:\> osql –U sa –P password –S localhost\myinstance

Or

C:\> osql –E –S localhost\myinstance

Creating a simple database with the Model template:

1> use master
2:> go
1> CREATE DATABASE Books
2> go
The CREATE DATABASE process is allocating 0.63 MB on disk 'Books'.
The CREATE DATABASE process is allocating 0.49 MB on disk 'Books_log'.

Delete the Books database

1> use master
2:> go
1> DROP DATABASE Books
2> go
Deleting database file 'C:\Program Files\Microsoft SQL
Server\MSSQL$MYINSTANCE\Data\Books_log.LDF'.
Deleting database file 'C:\Program Files\Microsoft SQL
Server\MSSQL$MYINSTANCE\Data\Books.mdf'.

Creating a database specifying the file name

1> use master
2> go
1> CREATE DATABASE Books
2> ON
3> ( NAME = books_dat,
4> FILENAME = 'D:\Database\books.mdf' )
5> go
The CREATE DATABASE process is allocating 0.63 MB on disk 'books_dat'.
The CREATE DATABASE process is allocating 0.49 MB on disk 'Books_log'.
  • NAME = Logical name used to specify the database in TSQL statements.
  • FILENAME = Physical location of the database on the hard drive.

Creating a database specifying the filename and the size

1> use master
2> go
1> CREATE DATABASE Books
2> ON
3> ( NAME = books_dat,
4> FILENAME = 'D:\Database\books.mdf',
5> SIZE = 10,
6> MAXSIZE = 100,
7> FILEGROWTH = 5 )
8> go
The CREATE DATABASE process is allocating 10.00 MB on disk 'books_dat'.
The CREATE DATABASE process is allocating 2.50 MB on disk 'Books_log'.
  • NAME = Logical name used to specify the database in TSQL statements.
  • FILENAME = Physical location of the database on the hard drive.
  • SIZE = Initial file size.
  • MAXSIZE = The database maximum size.
  • FILEGROWTH = Increments of the database file. The DB file will grow with this size in MBs.

Creating a database specifying the filename, size, and logfile

1> use master
2> go
1> CREATE DATABASE Books
2> ON
3> ( NAME = Books_dat,
4> FILENAME = 'D:\Database\books.mdf',
5> SIZE = 10,
6> MAXSIZE = 100,
7> FILEGROWTH = 5 )
8> LOG ON
9> ( NAME = 'Books_log',
10> FILENAME = 'D:\Database\bookslog.ldf',
11> SIZE = 5,
12> MAXSIZE = 50,
13> FILEGROWTH = 2 )
14> go
The CREATE DATABASE process is allocating 10.00 MB on disk 'Books_dat'.
The CREATE DATABASE process is allocating 5.00 MB on disk 'Books_log'.
  • NAME = Logical name used to specify the log and the database in TSQL statements.
  • FILENAME = Physical location of the log file and the database on the hard drive.
  • SIZE = Initial file size.
  • MAXSIZE = The log and the database maximum size.
  • FILEGROWTH = Increments of the log and the database file. The DB file will grow with this size in MBs.

How do I list all the databases on the system?

If you want to list all the databases in the instance, please open the osql utility and do the following query:

C:\ >osql -E -S localhost\myinstance
1> use master
2> go
1> select name from sysdatabases
2> go
 name
------------------------------------
master
tempdb
model
msdb
test
Products
 (6 rows affected)

In this example, I have created two databases: test and Products.

How do I detach a database from the system?

To detach a database called larsinge from the system, please do the following:

1> exec sp_detach_db 'larsinge'
2> go

In this example, we detached a database called “larsinge”. The database can now be moved, backed-up, or you can do whatever you want to do with the files.

How do I attach a database to the system?

Simply do this to connect a database called larsinge:

1> exec sp_attach_db @dbname = 'larsinge',
2> @filename1 = 
      'C:\Program Files\Microsoft SQL Server\MSSQL$LITBASE\Data\larsinge.mdf',
3> @filename2 = 
      'C:\Program Files\Microsoft SQL Server\MSSQL$LITBASE\Data\larsinge_log.LDF'
4> go

How do I list all tables in a database?

If you want to list all tables in an instance, please open the osql utility and do the following query:

C:\ >osql -E -S localhost\myinstance
1> use Products
2> go
1> select name from sysobjects where type = 'U'

In this example, we list all tables in the Products database in the myinstance. Type ‘U’ means “User Table”. Please try to change type to “S” if you want to list out all System tables.

C:\ >osql -E -S localhost\myinstance
1> use Products
2> go
1> select name from sysobjects where type = 'S'

Database users

Add and grant user access to the database.

Add a new user with SQL authentication:

This will add a new SQL login user ‘lars’ with the password ‘pass45’ and set the default database to ‘larsinge’. After creating the user, remember to grant access to the database and the tables for the user.

1> use master
2> go
1> EXEC sp_addlogin 'lars', 'pass45', 'larsinge'
2> go
New login created.

Grant access to the database:

1> use larsinge
2> go
1> EXEC sp_grantdbaccess 'lars'
2> go
Granted database access to 'lars'.
1> grant all on table_name to lars
2> go

With Win authentication

Database name is ‘larsinge’, the Win auth user is ‘TARGUS\testuser’:

1> use larsinge
2> go
1> exec sp_grantdbaccess 'TARGUS\testuser'
2> go
Granted database access to 'TARGUS\testuser'.

How to list all users and roles in a database?

Please open the osql utility, and do the following query to list all users in the Products database:

1> use Products
2> go
1> select name from sysusers
2> go

How to remove users from a database

This is how you revoke a user ‘lars’ access to the database ‘larsinge’.

1> use larsinge
2> go
1> exec sp_revokedbaccess 'lars'
2> go

Exit osql

1> quit

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Lars-Inge Tønnessen
Web Developer
Norway Norway
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralThanks for the FAQ listmemberSudarpo Chang21 Apr '10 - 17:34 
Thanks a lot for this guide.
I was troubleshooting an old system and can't find a more helpful guide than this.
BOOKMARKED!!
 
More references from MSDN:
MSDN - How to verify and change the system administrator password in MSDE[^]
MSDN - How to specify a strong SA password[^]
QuestionCan you update the link?memberJoe Pool9 Apr '08 - 6:04 
The link to the download is no longer valid, probably because it was for version 2000, and Microsoft now has 2005 and 2008.
 
Would the author mind updating this page to include current links and maybe talk about current technologies?
 
It is a great article, and I hate tossing it just because it doesn't apply anymore.
 
I would love to see this article updated for SQL Server CE, which is also free. I don't know how to configure it or where to download it, either.
 
Regards,
Joe
GeneralDistribution Problem in javamembershahidalikhan30 Sep '06 - 8:15 
I want to distribute my java application which uses SQL Server 2000 database with MSDE.How i do it
Please HElp me
Thanks
 
Shahid Ali
QuestionHow can i use SQL Server2000 database without using SQL Server In javamembershahidalikhan30 Sep '06 - 8:07 
I have developed an application in java that uses SQL Server 2000 database now i want to use this application with out using SQL server 2000 running on the system
If Yes
PLease Help me
Shahid Ali
 
Shahid Ali
Questionhow can I grant user the swpro with system administrator permission/privilege??membersunnycode23 Aug '06 - 7:09 
Dear friends:
I use MSDE in window XP so far, I created a user called swpro, but a new application asks this user swpro must have system administrator permission/privilege,
Please help in MSDE, how can I grant user the swpro with system administrator permission/privilege??
What command I should use??
 
Thanks a lot!!
sunny
 

QuestionHow can ImemberMoNa MoOn28 Jun '06 - 21:32 
hello
 
I want to make a databse with interface
 
I use Oracel>SQL
 
I want to use the MFC to make the interface
 
How Can I apply the steps which are in this link
 
http://www.functionx.com/visualc/databases/sqltable.htm
GeneralUsing full SQLServer GUI tools with MSDEmemberFred_Smith26 Jun '06 - 9:07 
Can I use Query Analyzer, Enterprise Manager and even the DTS tools from my machine to access and manage a remote instance of MSDE?
thanks
Fred
GeneralRe: Using full SQLServer GUI tools with MSDEmemberLars-Inge Tønnessen26 Jun '06 - 10:48 
Yes, just like you manage any instances of SQL Server 2000.
 
(With the SQL Server 2005 express it's included.)

GeneralMSDE runs from administrator account only [modified]membermaksim.simkin6 Jun '06 - 3:37 
Hallo, I have installed MSDE 2000a from my Administrator account. But when i log in as a user without administratot rights, there is no instance of msde running, SQL Server service manager is running, but it sees no instance of database to which he can connect.
How can i make the msde database available for all users of the computer ?
Thank you.
 

-- modified at 9:46 Tuesday 6th June, 2006
GeneralGreat Articlememberiamnoguru6 May '06 - 3:53 
I was abl to use the tips here to get my program on a win 98 machine to read a database on the server on my win2k machine by setting the datasource name on the win98 machine as a systemdatasource name and linking it to the win2k server it still says record is read only when I try to update but I will fix that.Smile | :)
Generalmsde not accepting paramters properlymemberLalitesh Kumar20 Apr '06 - 4:33 
hi,
 
i am having very strange problem.i am having a c++ application which is connecting to msde (sp2).sometimes it fails running and shows that it is not accepting parametres.
 
trace shows something passing as null in any field.next time the trace shows some different field being passed as null.
 
machine is on xp professional.
the same machine with the same database on sql server on another machine will work fine and there is no problem at all.
 
any input will be thankfulSmile | :)
 
Lals
 
-- modified at 10:35 Thursday 20th April, 2006
GeneralChange the MSDE Portmemberlakshmi patil10 Apr '06 - 0:24 
How can i change the msde default port 1433 to some other port
please tell me
lakshmi
GeneralStrange Problem with MSDE 2000 Over networkmemberVipul \3 Nov '05 - 19:29 
I am using Installshiled X to distribute my VB application which use MSDE 2000 as database. I have configured MSDE 2000 Object (provided by Installshield) to enable network protocol. I am facing 2 problems, the first problem is, I am not able to access my database from other machine.. and the second problem is, when I connect my Network cable, and when my application access local MSDE database, the response is very slow!!!!! As soon as I disconnect network cable the database just responds normally.... I have MSDE 2000 with SP3. And this problem comes on all OS Win 2K, XP.. Any help would be greatly appreciated.....
 
eZee
Generaluser idsussAnonymous6 Oct '05 - 14:20 
I keep getting an error that my user id is incorrect. Where can I located my correct user id?
GeneralRe: user idmemberjustus_s10 Aug '06 - 1:14 
Please check the Setup.ini file for the correct user Id
 
Justus
QuestionHow i can enable TCI/IP protocolsussPraful Goyal19 Sep '05 - 23:25 
How i can enable TCI/IP protocol through command line or any other way with out using user interface available in SvrNetCn.exe
AnswerRe: How i can enable TCI/IP protocolmemberAndiM28 Dec '05 - 7:56 
DISABLENETWORKPROTOCOLS=0 Setting this parameter to 0 enables network support necessary to allow other computers to connect to the MSDE instance.
 
I hope, that helps you!
 
Greetings, Andi!
GeneralRe: How i can enable TCI/IP protocolmemberChinHim21 Nov '06 - 14:00 
use svrnetcn.exe
GeneralLocalized stringmemberrigh8 Sep '05 - 4:30 
I use the MS Bootstrap for my setup.
 
Is there a neutral localized setting I can use?
 
I don't know my customers settings? An install should complete without errors. I will be sending demo cd's to clients.
 
This is from the help files.
Setup.exe by default reads the Setup.ini file for the strings displayed during installation. It checks gets the operation system's Locale ID, and then reads the INI file for a section with that code. For example, US English is 1033. If the Local ID provided by the operation system is not defined in the Setup.ini file, the program defaults to the values for US English.
 
My install still crash. Any help please!!!!!!
Generaldisabling workload governorsussAnonymous5 Sep '05 - 0:58 
this may be useful if you're having performance problems due to MSDE's workload governor (it only allows up to eight concurrent processes to run at full speed, considerably slowing down any others):
 
http://groups.google.com/group/microsoft.public.sqlserver.msde/msg/621f935f68ac4e8b?fwc=1
GeneralRe: disabling workload governorsussLars-Inge5 Sep '05 - 2:08 
Please see the next page. Blush | :O )

Generalcreate viewsussAnonymous29 Aug '05 - 0:07 
Hello frns,
 
How can i create a view in MSDE.
Plz reply with steps
uuuuuuuuuuuuuuuuurgent
thanx in advance
bye
Basu
GeneraldfgsussAnonymous29 Aug '05 - 0:03 
dfg
Generalusing MSDE with accessmemberankur6ue25 Aug '05 - 6:44 
hello,
I installed MSDE on my computer and I'm trying to use it with Access. I can successfully create a .adp file and create the column names for my table, but there doesn't seem to be any way to enter any data in the table..
anyone has had the same problem? any suggestions?
thanks,
Ankur
Questionwhere can I retain the password of 'sa' without uninstalling MSDE.?memberpubududilena5 Aug '05 - 1:15 
hi all,
I am using MSDE for my Applications.
My Problem is like this:
I have installed MSDE in computer perfectly .But I didn't rember the password for 'sa'.
 
So where can I retain the password of 'sa' without uninstalling MSDE.?
 
Thanks in advance.
 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 14 Nov 2004
Article Copyright 2004 by Lars-Inge Tønnessen
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid