Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

isql Question - hiding the password in a batch file

4 posts in Windows NT Last posting was on 2001-05-02 19:57:27.0Z
Jorge Posted on 2001-05-01 19:01:45.0Z
From: "Jorge" <iamjas99@hotmail.com>
Subject: isql Question - hiding the password in a batch file
Date: Tue, 1 May 2001 15:01:45 -0400
Lines: 11
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <mV2$3Pn0AHA.178@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: hboc.com 139.177.224.128
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:847
Article PK: 1087454

Hi. I am running Sybase 11.9.2 on NT 4.0 srv pk 6. I use isql extensively in
batch files and so forth. Others who do not have 'sa' permissions use the
machine as well. Is there a way to run isql in a batch file while hiding the
password somehow? Perhaps piping in the text from another file or
environment variable?

Thanks in advance.

Jorge Ascunce


Ray DiMarcello Posted on 2001-05-02 19:57:27.0Z
From: "Ray DiMarcello" <rdimarcello@ingva.com>
References: <mV2$3Pn0AHA.178@forums.sybase.com>
Subject: Re: isql Question - hiding the password in a batch file
Date: Wed, 2 May 2001 15:57:27 -0400
Lines: 24
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <52#yYU00AHA.191@forums.sybase.com>
Newsgroups: sybase.public.sqlserver.nt
NNTP-Posting-Host: 207.245.124.67
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:828
Article PK: 1087435

REM this sets an environment variable sa_pwd. Only the id that your isql
jobs run under should have read permissions on the share.
call \\servername\share\set_sa_pwd.bat

isql -Usa -Ssqlserver -P%sa_pwd%

Jorge wrote in message ...
>Hi. I am running Sybase 11.9.2 on NT 4.0 srv pk 6. I use isql extensively
in
>batch files and so forth. Others who do not have 'sa' permissions use the
>machine as well. Is there a way to run isql in a batch file while hiding
the
>password somehow? Perhaps piping in the text from another file or
>environment variable?
>
>Thanks in advance.
>
>Jorge Ascunce
>
>


Doug Wittich Posted on 2001-05-02 19:04:02.0Z
Message-ID: <3AF05A22.C345685D@stpaul.com>
Date: Wed, 02 May 2001 15:04:02 -0400
From: Doug Wittich <doug.wittich@stpaul.com>
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: isql Question - hiding the password in a batch file
References: <mV2$3Pn0AHA.178@forums.sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 51
NNTP-Posting-Host: portald.stpaul.com 208.201.108.75
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:831
Article PK: 1087438

The faq has a lot of good suggestions for Unix, but many are tough to replicate
on NT. It may be possible to use some of that with MKS Toolkit, but I've not
done "unix" scripting with that tool yet. But it's great for getting grep, awk
and other goodies on NT. Even VI is pretty cool on NT.

When I was using NT a lot, I wrote a process that worked like this:

I created a table in a little database server that not many people knew about.
I created a batch file that would access the table and set the userID and
password, based on the job name. This batch file had a hard-coded password in
it for accessing the password server, BUT... It was also in a secured directory
that only the job submission system (JSO/AQM) had access to. Also, this batch
file turned off ECHO, so it's output was not displayed in the output file that
the AQM server captured as the job executed. The application would pass the SQL
file to be executed, and the server to execute on to my process. My process
would then get the ID and password, then execute the script, redircting it's
output to the AQM job log file.

It was not 100% secure, but it was better than having a password out in the
open. The key to it's security was that nobody could see the inside of my
script, and it did nothing to reveal to the outside what the password was it was
using or that it was getting to process the app sql.

Another method would be to have a process get the password from somewhere and
insert it as the first line in the SQL input file. This is kinda what some of
the FAQ answers are showing.

doug

Jorge wrote:

> Hi. I am running Sybase 11.9.2 on NT 4.0 srv pk 6. I use isql extensively in
> batch files and so forth. Others who do not have 'sa' permissions use the
> machine as well. Is there a way to run isql in a batch file while hiding the
> password somehow? Perhaps piping in the text from another file or
> environment variable?
>
> Thanks in advance.
>
> Jorge Ascunce


Bret Halford Posted on 2001-05-01 20:08:28.0Z
Message-ID: <3AEF17BC.EEF16F@sybase.com>
Date: Tue, 01 May 2001 14:08:28 -0600
From: Bret Halford <bret@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.5 [en]C-CCK-MCD (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: isql Question - hiding the password in a batch file
References: <mV2$3Pn0AHA.178@forums.sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.sqlserver.nt
Lines: 14
NNTP-Posting-Host: bret-pc.sybase.com 157.133.80.211
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.sqlserver.nt:845
Article PK: 1087452

Check out http://www.isug.com/Sybase_FAQ/ASE/section4.html#4.1 , perhaps
one of the techniques discussed there will work on NT as well.

-bret

Jorge wrote:

> Hi. I am running Sybase 11.9.2 on NT 4.0 srv pk 6. I use isql extensively in
> batch files and so forth. Others who do not have 'sa' permissions use the
> machine as well. Is there a way to run isql in a batch file while hiding the
> password somehow? Perhaps piping in the text from another file or
> environment variable?
>
> Thanks in advance.
>
> Jorge Ascunce