Hi,
Does the command-line utility osql.exe has any external dependencies?
I'm building a java installer that needs to interact with MSSQL with
osql.exe. Now the temporary solution is to ensure the machine on which
the installer is run has either MSDE or MSSQL client installed, but that
is clearly not a long-term solution. Can i just take osql.exe and
package it into my installer so that i can interact with MSSQL database
server without MSDE or MSSQL client installed?You can't just take osql.exe and package it in the installer, as you are not
allowed to redistribute it. But anything you can do with osql.exe, you can
do with JDBC as well.
Jacco Schalkwijk
SQL Server MVP
"Zhu Bo" <bo.zhu@.encentuate.om> wrote in message
news:%2375I4hENFHA.3420@.tk2msftngp13.phx.gbl...
> Hi,
> Does the command-line utility osql.exe has any external dependencies? I'm
> building a java installer that needs to interact with MSSQL with osql.exe.
> Now the temporary solution is to ensure the machine on which the installer
> is run has either MSDE or MSSQL client installed, but that is clearly not
> a long-term solution. Can i just take osql.exe and package it into my
> installer so that i can interact with MSSQL database server without MSDE
> or MSSQL client installed?
Showing posts with label command-line. Show all posts
Showing posts with label command-line. Show all posts
Monday, March 12, 2012
osql utility dependency
Wednesday, March 7, 2012
OSQL didnt like rookies
Sory for fullish question,but i'm coming from DB2 and Oracle world,and not SQL world.
How I can understand,OSQL utility is command-line utility in SQL server.So,I tried to start it,but it failed with error:
Login failed for user 'Administrator'. Reason: Not associated with a trusted SQL Server connection.
There is some properties for my sqlserver:
Authentication is "Windows only".User Administrator is admin on machine.In Windows services,there is one servis ( started) and logon for that service is Administrator.In fact,my SQL server works fine,because other GUIs works ok.
SQLSERVERNAME=hostname=navtest.
I tried to logon by entering in cmd this
osql -S NAVTEST
but every time I see error :
Login failed for user 'Administrator'. Reason: Not associated with a trusted SQL Server connection.
What i am doing wrong?
Every help will be greatJust because the sql service runs under the Administrator's account doesn't meen the Administrator can log onto the SQL Server.
By default, the Microsoft SQL Server setup creates the "BUILTIN\Administrators" login, which gives any account in the Local Administrators group system administrator (sa) privileges. Most people delete this account, could be the problem you are facing.
You can add the local Admin account back and grant that account sa privileges.|||Thanks,Paul!
I entered osql -s <servername> -E and it works!
Now,I tried to enter some commands,but I don't know how to end it.
I tried this:
1> select * from northwind......
2>
3> /
4>
Now,how You say to SQLSERVER execute commands?
Thanks a lot,Zvonimir|||hum... when you tried the -E what userid had you logged in with?
go terminates a block of commands.|||I find that switch -E by searching this forum...
And GO really works!!!
Thanks,Zvonimir|||Could have also found it by looking in Books Online. You can also change the command terminator with the -c switch.
btw, what userid were you using when you had success with the -E switch, Administrator?|||-E switch explicitly specifies your intent to log on using trusted connection. The default behavior for OSQL is to use Standard SQL Server Security. That's why Z was getting his(/her) error at the beginning. With -E switch the logon succeeded using security context of the currently logged on user, - Administrator.
How I can understand,OSQL utility is command-line utility in SQL server.So,I tried to start it,but it failed with error:
Login failed for user 'Administrator'. Reason: Not associated with a trusted SQL Server connection.
There is some properties for my sqlserver:
Authentication is "Windows only".User Administrator is admin on machine.In Windows services,there is one servis ( started) and logon for that service is Administrator.In fact,my SQL server works fine,because other GUIs works ok.
SQLSERVERNAME=hostname=navtest.
I tried to logon by entering in cmd this
osql -S NAVTEST
but every time I see error :
Login failed for user 'Administrator'. Reason: Not associated with a trusted SQL Server connection.
What i am doing wrong?
Every help will be greatJust because the sql service runs under the Administrator's account doesn't meen the Administrator can log onto the SQL Server.
By default, the Microsoft SQL Server setup creates the "BUILTIN\Administrators" login, which gives any account in the Local Administrators group system administrator (sa) privileges. Most people delete this account, could be the problem you are facing.
You can add the local Admin account back and grant that account sa privileges.|||Thanks,Paul!
I entered osql -s <servername> -E and it works!
Now,I tried to enter some commands,but I don't know how to end it.
I tried this:
1> select * from northwind......
2>
3> /
4>
Now,how You say to SQLSERVER execute commands?
Thanks a lot,Zvonimir|||hum... when you tried the -E what userid had you logged in with?
go terminates a block of commands.|||I find that switch -E by searching this forum...
And GO really works!!!
Thanks,Zvonimir|||Could have also found it by looking in Books Online. You can also change the command terminator with the -c switch.
btw, what userid were you using when you had success with the -E switch, Administrator?|||-E switch explicitly specifies your intent to log on using trusted connection. The default behavior for OSQL is to use Standard SQL Server Security. That's why Z was getting his(/her) error at the beginning. With -E switch the logon succeeded using security context of the currently logged on user, - Administrator.
Subscribe to:
Posts (Atom)