OSQL use in batch file

osql -E -d %DBNAME% -Q "%SQLQuery%" -S %DBSERVER%

ie To put a database in single user mode, use "master" as the database.
osql -E -d master-Q "alter database %DBNAME% set single_user with rollback immediate" -S %DBSERVER%

Comments

Popular posts from this blog

Corporate Intranet Information Architecture – a Publishing Site

No Search Results in SharePoint Contextual Search OSSSearchResults.aspx

The long sad road to getting Metastorm, SharePoint, and Kerberos to work together in a multiple server farm.