Hi Mark,
1. Stop DB.
2. Duplicate SP1 folder named "Windows Embedded Data" to let say WEDBKP folder name.
3. Install SP2.
Make a batch file that will do following.
1. Stop DB.
2. Close net share on Repositories.
3. Rename "Windows Embedded Data" to let say WEDBKP2
4. Rename WEDBKP to "Windows Embedded Data"
6. Rename WEDBKP2 to WEDBKP
7. Start net share on Repositories.
8. Start DB.
Hi, Slobodan
There is some information about the database in the system databases too,
so maybe instead of stopping the server and swapping the .mdf and .ldf
files underneath it, it could be safer to detach one version and attach the
other.
This can be done from a batch file too, through oqsl.exe (in the SQL Server
installation path, .\80\Tools\binn subdirectory).
osql -E -Q "sp_detach_db 'MantisSQLDB'"
2. Close net share on Repositories.
3. Rename "Windows Embedded Data" to let say WEDBKP2
4. Rename WEDBKP to "Windows Embedded Data"
6. Rename WEDBKP2 to WEDBKP
7. Start net share on Repositories.
set f1=X:\Windows Embedded Data\MantisSQLDB_Data.mdf
set f2=X:\Windows Embedded Data\MantisSQLDB_Log.ldf
osql -E -Q "sp_attach_db 'MantisSQLDB', '%f1%', '%f2%'"
I used environment variables for the filenames only to shorten the last
command line, so it's not broken in this post by the time you read it.
There's one drawback: sp_detach_db will fail if the database is still open
somewhere, and checking the return value in a single line sounds easier
than it is.
I thought executing the command as
osql -E -Q "exit(exec sp_detach_db 'MantisSQLDB')"
should store the result in %errorlevel%, but it looks like that doesn't
work with stored procedures (I always get errorlevel = -100).
Maybe we could ask for help in one of the SQL server groups
