Page 1 of 1

sql script

Posted: Mon Aug 13, 2007 5:30 am
by coder12345
Hi,

I'm having trouble getting the sql script to create a non-existing database and then execute the script on it. I'm not exactly sure what the problem is, I am using the correct sa password. Any help would be greatly appreciated! Thanks!

Posted: Mon Aug 13, 2007 9:35 am
by Alex_Ronquillo
Please give more details about this. Are you getting some kind of error? Can you include the script you are using? What version of IA are you using? What OS are you using?

sql script

Posted: Wed Aug 15, 2007 6:54 am
by coder12345
I'm not getting any error messages, the database is just not being created and the sql script is not running.


IA7 WinXPSP2


****Updated****

Sorry, I thought I had attached this jpg. The problem that I'm having is that the database 'UserDatabase' is not being created.

File Attached:

untitled.JPG

Posted: Wed Aug 15, 2007 6:55 am
by neillans
Can you post *exactly* the command you are using (and your script)?

One thing that people always seem to forget, is before you can create a database you need to OPEN an already existing database - the typical one is the default "master" :)

sql script

Posted: Thu Aug 16, 2007 11:59 am
by coder12345
Sorry, I thought I had attached this jpg. The problem that I'm having is that the database 'UserDatabase' is not being created.

File Attached:

untitled.JPG

Posted: Thu Aug 16, 2007 12:45 pm
by Alex_Ronquillo
I am not sure if (local) works for local installation of MS SQL. Please try "localhost" instead and let me know the result

Posted: Thu Aug 16, 2007 12:57 pm
by Gizm0
Alex_Ronquillo wrote:I am not sure if (local) works for local installation of MS SQL. Please try "localhost" instead and let me know the result


It works. The default for MS SQL IS (local) not localhost or anything like that. It's either IP or (local).

Now, to the question. You forgot to OPEN a new database as neilans told you above. Please insert this "USE [Biodb] GO" before setting the date format. It's even better to create the database from within a script than leaving IA to do it.

sql script

Posted: Thu Aug 16, 2007 4:10 pm
by coder12345
Hi,

Thanks for all the suggestions. =) I am still having some problems.

I tried "USE [Biodb] GO" and also "USE master GO" but the database 'UserDatabase' is still not being created.


Gizm0 wrote:It's even better to create the database from within a script than leaving IA to do it.


Where would be the a nice, reliable place to put this script? Should I do it within IA?
I kind of wanted to rely on IA to create this database for me since I'm not an SQL expert or anything. What are the pros and cons of relying on IA to do it for me vs. doing it myself?

Thanks!