On the computer that is hosting the instance of MSDE to which you are connecting, open the command prompt window.
Type the following command, and then press ENTER:
osql -U sa
At the Password: prompt, press ENTER if your password is blank or type the current password. This connects you to the local, default instance of MSDE by using the
sa account. To connect by using Windows authentication, type this command: use osql -E
Note If you are using SQL Server 2005 Express, avoid using the Osql utility, and plan to modify applications that currently use the Osql feature. Use the Sqlcmd utility instead.
For more information about the Sqlcmd utility, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms165702.aspx
Type the following commands, on separate lines, and then press ENTER:
1>sp_password @old = null, @new = 'complexpwd', @loginame ='sa'
1>go