X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=JFdZq/62r8CzWLLs1cuo5MlmiD9ssN7NHy9Ib+mYEJt I8mu12fWnj5pxHY3+OdBZKIObJgXEdyQ9trIaq4P0e31qTKcUzIvwLNNf5V8SHVY BlVaSeEfg+cvzLVcvuUJ7KDsdF5GatLcz8++S6Ofuw6QmDIO1PrRiJewMTjIgonA = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=rGYuFZR/0aCraLT0m0ttQx2AV/Q=; b=mferLvUxAwP0/p10l WcTT/MaVHtdkvfKx0hLya4p0Smpg+87VA/SSc4uEbCB/zS8GksgIjW6rv9AtxueW MSjzy63wdNaSrrRYEYWce21iFO06Ze+4ncb1VmNAviddO+vAV6a94W4gZU7RQHue 2MwvF6GmvOe4svCyDR/rkSISx4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f169.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=yZUIWqTZZHU57YUCiaWkS7jCHQJyYUxHBL+tjKmgxrM=; b=g2yqEMRjJKeiP1d4y44xrsE1eUuID98OIs1y77WKp0fdTXG+spOBzjwNkuKwtYcScJ ek79ZtvNoPFBMcjxYmxjzbEpit62aJsptog8aLsC0PWHDxP7MH614g2GBc/hKRmx2xEJ rJg/NjGMn6tqa1sCmVtoXiGpXtmV3xRtjUeXP3SgJ/9jCDgLfAFrWVUgDfAppVo8I2J4 HtpxTgNrluK74zzeUuUNUNmIONP0jrxCAvkR0Ds0vV2rdBwP1SvchnEx5h23IdxmIJnn NhoMPAyEnnTwA66Ei6mCtqQXqE7D65OuIZ/jr4S5Lu93jtdIn/uVjB6M5oQKT6BoW3kQ peEg== X-Gm-Message-State: ALoCoQmDuAzYzM4bWjPtL6/Nkf2eZXJl4+0xjy9hEcZqiHV7xcUu0O9cmFzM5vuZm+z6v8kYwl15 X-Received: by 10.42.92.194 with SMTP id u2mr50711043icm.19.1395685851701; Mon, 24 Mar 2014 11:30:51 -0700 (PDT) Message-ID: <533079D8.3000703@breisch.org> Date: Mon, 24 Mar 2014 14:30:48 -0400 From: "Chris J. Breisch" User-Agent: Postbox 3.0.9 (Windows/20140128) MIME-Version: 1.0 To: "cygwin AT cygwin DOT com" Subject: Re: SQL server utility not working when invoked(from a asp.net application) using cygwin References: <532F2E28 DOT 8020406 AT breisch DOT org> In-Reply-To: <532F2E28.8020406@breisch.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Chris J. Breisch wrote: > > Can you give more specifics on how it fails? And is it possible for you > to upgrade to a more recent version of Cygwin? I'm doing almost all of > this except for the ASP.net part, and I have no problems. I do this at > work, and I'm not at the office right now. It's possible I quote the > arguments differently. I can check in the morning. I also use Windows > authentication and not SQL authentication, but that shouldn't matter. In > fact, of the two, SQL authentication is the way less likely to cause > issues. > I checked on what I'm doing in my script. Here's an exact line of code from my shell script: ${SQLCMD} -E -d ${_db} -S ${_server} -o ${_dosOutput} -Q "${_query}" Where the variables are defined as follows: SQLCMD="sqlcmd.exe" _db= _server= _dosOutput= _query= Note that I'm not using bash redirection, but the sqlcmd option to send output to a file. The -E tells sqlcmd to use Windows Authentication (actually it uses impersonation, which has it's own set of quirks, but that's not an issue for you), rather than using the -U and -P options as you are. I did notice that in your original post you said -Q "sp_helpuser abc". I doubt that this is the problem, but -Q "exec sp_helpuser abc" is preferred. In my case, I'm not calling a stored procedure but passing an actual SQL select, insert, or update to sqlcmd. That shouldn't make any difference, though. I also recently had a problem executing something with sqlcmd, as I mistyped "-S" as "-s". I didn't notice that tiny typo for hours and pulled out quite a bit of hair. Make sure the case is correct for all your options. Without additional details on what is or isn't happening, this is as much assistance as I can provide. -- Chris J. Breisch -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple