473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Create Database by using OSQL

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
2 8324
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John A Fotheringham | last post by:
I'm trying to write a procedure that having created a new database, will then create within that new database all the tables and procedures that go with it. In doing this I'm hitting the problem...
4
by: Steve Richter | last post by:
I have an sql script that I ran on my local system using osql. It created all the tables, views, and even inserted sample data into the tables. Now I need to create that same database on a...
1
by: Florimond | last post by:
Can I use osql to known the database install on a server via 'guest' account ? I had over 300 servers with sql server all around France (different version : 6.5, 7 and 8) I need to check all...
5
by: Jax | last post by:
I know with SQL you can create a datatable with an SQL string, but is there anyway of creating an entire database using an sql string and some sort of command line program? (Command line; see:...
10
by: Cem Louis | last post by:
Hi, Q1: How can I transfer an SQL database manually? I have a database which is named mydb, I looked at the harddrive and found it on "C:\Program Files\Microsoft SQL Server\MSSQL\Data" there is...
2
by: Dave | last post by:
I need to create an executible that will run on a nightly basis. The executible is a simple command line statement like: OSQL -Usa -PmyPasword -n -Q "BACKUP DATABASE msdb TO DISK =...
1
by: And | last post by:
I everyone! I'm a new asp.net user and I'm trying to run some sample files from de msdn database and most of them use the pubs database. My problem is that although I see the pubs database in...
6
by: Ober | last post by:
I'm having trouble with my security model, Application_Start, and accessing my database. My ASP.NET app is only going to be running in an intranet environment (not on the public Internet). ...
0
by: MikeB | last post by:
Problem : I am maintaining a legacy application which is distributed with a default database, loaded from a file called Master.dat. I wish to update the values of 10 fields in 1 table. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.