June 18, 2004 at 6:50 am
I am trying to run a batch script using the command prompt utility osql. I am using MSDE 2000. I also want to use SQL Server authentication and not the Windows authenication. Windows authentication works fine but I want to use SQL server authentication. Below is the syntax I am using:
osql -Uscott -Ptiger -----> This gives me an error. But when I use the option -E and dont use U/P I can login. Can someone help me login using SQL Server authentication.
Thanks,
Srinivas.
June 18, 2004 at 7:03 am
I just tried on my system the following:
osql -Usa -Pxxxx -SMyPCName and it logged right in. Is the scott user set-up properly?
Good Hunting!
AJ Ahrens
webmaster@kritter.net
June 18, 2004 at 7:08 am
AJ I tried your suggestion and I still couldn't login :
C:\Documents and Settings\svippagu>osql -Uscott -Ptiger -Ssvippagu-2000
Login failed for user 'scott'.
What do you mean by "scott user set-up properly". Is there anything I can check for??
Thanks,
Srinivas.
June 18, 2004 at 7:31 am
Is the MSDE Engine set for Windows authentication only?
Is scott a valid login for the MSDE in question?
K. Brian Kelley
@kbriankelley
June 18, 2004 at 7:38 am
When I installed I think Windows authentication is the default one, but I later changed it to mixed mode from the by right-clicking on the server -->properties-->security. Yes,Scott is set up as a valid login. I can login as Scott using the SQL Query Analyzer but not from the command prompt using osql.
Thanks,
Srinivas.
June 18, 2004 at 7:58 am
How about when you attempt to log in with the sa account. Same issue?
K. Brian Kelley
@kbriankelley
June 18, 2004 at 8:00 am
I can login successfully with the sa account.
Thanks,
Srinivas.
June 18, 2004 at 8:03 am
Is MSDE installed as case-sensitive? If so, scott and Scott are different, if I recall correctly.
Try connecting without the -P flag. It should then prompt you for a password. See if that makes any difference.
K. Brian Kelley
@kbriankelley
June 18, 2004 at 8:08 am
Hey Brian, I tried the following syntax and it worked
osql -Uscott -Ptiger -Ssvippagu-2000\sqlserver2000.
svippagu-2000 is the host and sqlserver2000 is the name of the sql server. I wonder why I have to specify this -S flag to make it work???
Thanks,
Srinivas.
June 18, 2004 at 9:43 am
Looks like MSDE installed as an instance. You don't have to specify this in Query Analyzer?
K. Brian Kelley
@kbriankelley
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply