0
를 통해 VBScript를 :SQLCMD는 JScript의 중단하지만 나는 두 개의 스크립트, vbtest.vbs 및 jstest.js이 WSH
vbtest.vbs :
Set sh = CreateObject("WScript.Shell") WScript.echo(sh.exec("sqlcmd -S my-server\name -U user -P pass -Q ""exit(USE [schemaName];SELECT COUNT(*) as Count FROM [myView] where [myColumn] = 'mySearchString';)""").StdOut.ReadAll)
jstest.js :
var sh = new ActiveXObject("WScript.Shell"); WScript.Echo(sh.exec("sqlcmd -S my-server\name -U user -P pass -Q \"exit(USE [schemaName];SELECT COUNT(*) as Count FROM [myView] where [myColumn] = 'mySearchString';)\"").StdOut.ReadAll());을
vbtest를 실행할 때 예상되는 결과를 얻습니다.
HResult 0x35, Level 16, State 1 Named Pipes Provider: Could not open a connection to SQL Server [53].
감사합니다, 나는 내가 놓친 믿을 수 없어 .... 그, 특히 내가 "이스케이프 고려. – Corey