Shutdown MSSQL server from perl script DBI -
i'm writing perl script in i've shutdown mssql server ,do operation , i've restart it.i know 1 way use netstat stopt service cann't use that. tried installing dbi , dbd::odbc module.i'm able connect , execute queries following code
use dbi; $data_source = q/dbi:odbc:automation_wow64/; $user = q/pa/; $password = q/dce/; # connect data source , handle connection. $dbh = dbi->connect($data_source, $user, $password) or die "can't connect $data_source: $dbi::errstr"; $str=$dbh->prepare("select serverproperty('edition')"); $str->execute(); @row; while (@row = $str->fetchrow_array) { # retrieve 1 row print join(", ", @row), "\n"; }
but after searching lot i cann't find query using whch can shutdown server. wanted know possible shutdown server sql query . found 1 mysql server
$rc = $dbh->func('shutdown', 'admin');
at link http://metacpan.org/pod/dbd::mysql please tell me if similar exist mssql server.
there's sql command called shutdown
- more info here
Comments
Post a Comment