By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,766 Members | 1,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,766 IT Pros & Developers. It's quick & easy.

Create Database by using OSQL

P: n/a
I have to create database usign OSQL. i am usin a command like this

C:> osql -E -i db1.sql

But it doesnt create database and returns error saying user login
failed for administrator whereas I have no user for SQL server n it
uses by default . I also tried with sa username by entering it with -U
switch in command but still it gaves same error. Can anyone help me

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi

You will need to post db1.sql to be certain. Try using the command without
specifying the file and see what it says. If you are not connecting to the
default instance/database then specify the server -S flag (it may be better
to do this regardless!) and database -d flag as well. If you are not an
administrator (or the BUILDIN\Administrators group has been removed from the
logins) then specifying -U sa -P<sa password>.

John

<ar********@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have to create database usign OSQL. i am usin a command like this

C:> osql -E -i db1.sql

But it doesnt create database and returns error saying user login
failed for administrator whereas I have no user for SQL server n it
uses by default . I also tried with sa username by entering it with -U
switch in command but still it gaves same error. Can anyone help me

Jul 23 '05 #2

P: n/a
ar********@hotmail.com (ar********@hotmail.com) writes:
I have to create database usign OSQL. i am usin a command like this

C:> osql -E -i db1.sql

But it doesnt create database and returns error saying user login
failed for administrator whereas I have no user for SQL server n it
uses by default . I also tried with sa username by entering it with -U
switch in command but still it gaves same error. Can anyone help me


If you get exactly the same error message if you specify "-U sa", then
the server is not configured for SQL authentication.

It would help if you posted the exact error message.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.