alias SQLL {
if ($2) {
if ($com(SQL)) { .comclose $ifmatch }
window -ae @SQL
.comopen SQL ADODB.Connection
set %SQL.ip $1 | set %SQL.u $2 | set %SQL.p $$3
if ($com(SQL,Open,1,string,$+(PROVIDER=MSDASQL;DRIVER={SQL SERVER};Server=,%SQL.ip,;UID=,%SQL.u,;PWD=,%SQL.u,;))) {
kte_echo @SQL <---> Connected to %SQL.ip ( $+ $+(%SQL.u,@,%SQL.p) $+ ) on port: 1344
kte_echo @SQL ---> $com(SQL, Execute, 1, *bstr, xp_cmdshell "dir c:\")
kte_echo @SQL ---> $com(SQL).result
}
else { kte_error @SQL $com(SQL).errortext ( $+ $com(SQL).error $+ ) | .comclose SQL }
}
else { kte_error -a Usage: /SQLL <ip> <user> [pass] }
}