Friday, March 9, 2012

osql permissions

I can get osql to work by using a standard Sql Server login. (Sql Server
2000) However, when I try to get it to work with something like the
following, it fails:
osql -S server -U domainwindowsadmin -P pw -Q"select top 1 * from table"
even though I'm using the domain password. This is a domain account that
works from my workstation.
Is there any way to get osql to work with Windows authentication?
Oh, and I don't want to manually type the password. I need it to be
"scriiptable".For Windows Authentication use the -E osql option (trusted connection).
Ben Nevarez, MCDBA, OCP
Database Administrator
"CLM" wrote:

> I can get osql to work by using a standard Sql Server login. (Sql Server
> 2000) However, when I try to get it to work with something like the
> following, it fails:
> osql -S server -U domainwindowsadmin -P pw -Q"select top 1 * from table"
> even though I'm using the domain password. This is a domain account that
> works from my workstation.
> Is there any way to get osql to work with Windows authentication?
> Oh, and I don't want to manually type the password. I need it to be
> "scriiptable".|||And do not use -U and -P, just -E (no password is required). osql will
connect to SQL Server using the currently connected Windows user.
Ben Nevarez, MCDBA, OCP
Database Administrator
"Ben Nevarez" wrote:
[vbcol=seagreen]
> For Windows Authentication use the -E osql option (trusted connection).
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "CLM" wrote:
>|||If you specify an ID and password it must be a SQL Server login.
If you want to use an NT id, it can only be the id under which OSQL is
running. In that case you must us a trusted connection, which means
you use the -E option and no id or password.
Roy Harvey
Beacon Falls, CT
On Tue, 11 Jul 2006 10:24:02 -0700, CLM
<CLM@.discussions.microsoft.com> wrote:

>I can get osql to work by using a standard Sql Server login. (Sql Server
>2000) However, when I try to get it to work with something like the
>following, it fails:
>osql -S server -U domainwindowsadmin -P pw -Q"select top 1 * from table"
>even though I'm using the domain password. This is a domain account that
>works from my workstation.
>Is there any way to get osql to work with Windows authentication?
>Oh, and I don't want to manually type the password. I need it to be
>"scriiptable".|||Thx guys.
"CLM" wrote:

> I can get osql to work by using a standard Sql Server login. (Sql Server
> 2000) However, when I try to get it to work with something like the
> following, it fails:
> osql -S server -U domainwindowsadmin -P pw -Q"select top 1 * from table"
> even though I'm using the domain password. This is a domain account that
> works from my workstation.
> Is there any way to get osql to work with Windows authentication?
> Oh, and I don't want to manually type the password. I need it to be
> "scriiptable".

No comments:

Post a Comment