OR
sqlcmd -s ./<sqlserver instance name> -q "DROP DATABASE <database name>"
Examples:
sqlcmd -s dbserver -u username -p password -q "DROP DATABASE products"
sqlcmd -s localhost -q "DROP DATABASE products"
sqlcmd -s ./MSSQLSERVER -q "DROP DATABASE products"
3 comments:
Should that be an upper case S for the server name/instance, ie. -S?
U and P should be upper also.
Does it set SINGLE_USER mode? Does it work if DB is busy?
Post a Comment