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

Metastorm - Open form in an action from a list or link

Corporate Intranet Information Architecture – a Publishing Site

No Search Results in SharePoint Contextual Search OSSSearchResults.aspx