mercredi 24 juin 2009

Commande et reconfiguration SQL Serveur (Express)

@ECHO OFF
@ECHO =============================================
@ECHO ::: Enabling User Instances
@ECHO =============================================
sqlcmd -S .\SQLExpress -Q "sp_configure 'user instances enabled' , 1;"
@ECHO.
@ECHO =============================================
@ECHO ::: RECONFIGURING
@ECHO =============================================
sqlcmd -S .\SQLExpress -Q "reconfigure;"
@ECHO DONE
@ECHO.
@ECHO =============================================
@ECHO ::: COMPLETED
@ECHO =============================================
PAUSE>NUL




Explanation:
sqlcmd :: sql command prompt
-S :: server setting
.\SQLExpress :: the sqlexpress server
-Q :: execute literal command and exit
"sp_configure 'user instances enabled' , 1;" :: the command to enable user instances
"reconfigure;" :: reconfigure for new settings to become active
@ECHO :: some feedback won't do any harm
PAUSE>NUL :: PAUSE while passing (>) feedback to NUL output

Aucun commentaire:

Enregistrer un commentaire