Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OSQL-connect only with sa possible???

Status
Not open for further replies.

joeka77

Technical User
Mar 14, 2003
31
DE
Hello, big problem: If i use the osql.exe-Tool to connect to a server, its only possible by uing an SQL-Account. But if i use a Windows-Account (SQL runs in mixed mode) i get the "access denied"-message. In order to install Projectserver with Teamservices (complicated) i need a Windows-Account. I tested it with the Administrator-Account and gave it all rights to the database!! But: SQL-Accounts work, Windows-Accounts does not!
Anybody can help me fix this problem?
 
First do not use -u and -p options. Second make sure there are no environment variables set for OSQL. These variables are set using dos SET commands. The variables are OSQLUSer and OSQLPASSWORD, and OSQLSERVER....

________________________________________________________________________________
If you do not like change, get out of the IT business...
 
Thanks, but i have to supply -U or -E. And using -E doesnt work ... :-(
 
According to Book Online, If you do not set any environment variables, then OSQL will connect using Windows accounts, i.e. the currently logged on user...Search book online for "osql" ... ________________________________________________________________________________
If you do not like change, get out of the IT business...
 
1)Open a command prompt and type:

Code:
set

Check the list of env variables and make sure the ones relating to SQL (as above) are not set.

2)If none set, try simply connecting with osql:

Code:
osql -Sservername -E

If this doesn't work then make sure your NT account actually has permissions to connect to the server!

If it does work then there must be a problem with the specific procedure you are trying to execute. --James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top