If you install WSS 3.0 and you install the default SQL Server Express edition you do not get an option to install the database to a specific location. By default the database is installed in C:\Windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data. If you have it installed on server hardware with drives configured for best performance and redundancy i.e. RAID 1 for OS and RAID 5 for applications, the default config needs changing. To move the database you need to perform the following steps:
1) Run C:\Program Files\Microsoft SQL Server\90\Tools\Binn>sqlcmd -S \\.\pipe\mssql$mic
rosoft##ssee\sql\query –E which opens up the SQLCMD line to perform database operations with
2) Identify the database files that you want to move in the default location which is C:\Windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data
3) Detach the SQL Database which you are moving. Run the following command to do this:
EXEC sp_detach_db @dbname = ‘WSS_Search’
4) Copy the database files and log files to the new location
3) Run the following command in the SQLCMD which sets the new location (changing the dbname and location as required):
EXEC sp_attach_db @dbname = ‘WSS_Search‘, @filename1 = ‘E:\windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data\WSS_Search.mdf‘, @filename2 = ‘E:\windows\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data\WSS_Search_log.LDF‘
Type Go to run the SQL Query.
4) Startup the IIS and Sharepoint services.