Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11

    Unanswered: create db with script

    I have an .sql script that I am using to create my db in sql2000. I am creating it as the sa user. In this script, I am also creating a user and putting them in the db_owner role. Upon load of data, I am the user I made.

    I keep getting an error :

    file:C:/Projects/CanidateManager/scripts/ant/targets-sql.xml:32: java.sql.SQLException: Lo
    gon failed. Msg 18456, Severity 14, State 1, Login failed for user 'sa'., Server , Proced
    ure , Line 0
    at org.apache.tools.ant.taskdefs.JDBCTask.getConnecti on(JDBCTask.java:352)
    at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLE xec.java:358)
    at org.apache.tools.ant.Task.perform(Task.java:341)
    at org.apache.tools.ant.Target.execute(Target.java:30 9)
    at org.apache.tools.ant.Target.performTasks(Target.ja va:336)
    at org.apache.tools.ant.Project.executeTarget(Project .java:1339)
    at org.apache.tools.ant.Project.executeTargets(Projec t.java:1255)
    at org.apache.tools.ant.Main.runBuild(Main.java:609)
    at org.apache.tools.ant.Main.start(Main.java:196)
    at org.apache.tools.ant.Main.main(Main.java:235)

    What am I doing wrong? I am not a database person persay so I have exhausted all my resources.

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    check the security mode of your sql box.

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    You don't show how you're executing it...why not use osql?

    Where are you executing this from as well

    Why do you need to have a database built by a front end (just a guess)
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    It is not from a front end but part of the installation when we send the software out to a new environment. I need to build the database and load it with needed data. I have an sa in the security folder with a password of sa with public and db_owner. I am calling this script with an ant build target.

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Whats an ant build target?

    I just use osql.exe
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Sep 2003
    Posts
    522
    is any gui involved in your installation? or you've hard-coded sa pwd into a script?

  7. #7
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    When I installed the sql server on my box, I created the sa user with password. So no, there is no gui to do this. Maybe I am missing something.

  8. #8
    Join Date
    Sep 2003
    Posts
    522
    wait a minute, you've "created" sa user???????

  9. #9
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    I do have a properties file that has the sa and password info in it so the script does not have any actual hard coding just a token. I'm using these just to assign who the user is when creating.

  10. #10
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    When I installed the sql it created the sa. I just made the password sa as well.

  11. #11
    Join Date
    Sep 2003
    Posts
    522
    oh, that's reassuring

    make sure you have either sql standard or mixed security mode enabled on the server.

  12. #12
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    How do I check that from Enterprise manager?

  13. #13
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Right click on the server, Select properties and look at the security tab
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  14. #14
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    It is set to both sql and windows authentication.

  15. #15
    Join Date
    Nov 2003
    Location
    Maryland
    Posts
    11
    So if that is set correctly, any other suggestions as to my issue?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •