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.
| Author |
Topic |
|
MassiveOverkill
Starting Member
20 Posts |
Posted - 2008-01-15 : 14:03:19
|
| EDIT: got it figured out, nevermindI am trying to write a script that will apply a service pack if the existing version isn't up to date. I've got most of the code, but need some help. Here is the script:ECHO ONNET START SQLBROWSER"%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\SQLCMD" -S "127.0.0.1\(myinstance)" -Q "SELECT @@VERSION" | FINDSTR "9.00.3152.00" IF %ERRORLEVEL% EQU 0 GOTO SQLUPDATEDIF %ERRORLEVEL% EQU 1 GOTO SQLNEEDSUPDATED:SQLUDPATEDECHO SQL IS UP TO DATEPAUSEGOTO END:SQLNEEDSUPDATEDECHO SQL NEEDS TO BE UPDATED, APPLYING UPDATE NOWECHO PLEASE BE PATIENT AS THIS MAY TAKE A FEW MINUTES TO UPDATE SQL WITH THE LATEST SERVICE PACKsqlserver2005-kb933097-x86-enu.exe /quiet /allinstancesPAUSEGOTO END:ENDNET STOP SQLBROWSERThe service pack file will be located in the same directory as the batch file. I appreciate any help |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-01-15 : 16:17:31
|
| moved from script library_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com <- new version out |
 |
|
|
|
|
|