![]() | |
#41
| |||
| |||
|
|
Uri, The script creates tables and stored procedures. Even if I don't run the script, I can't connect to the database with osql.exe. I am able to access the database with the SQL Management Studio. Rob "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%232zW04W5IHA.3784 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Rob What does CreateDBObjects.sql script do? Can you connect to the NewDB via SSMS? "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:%23NMPnLV5IHA.1200 (AT) TK2MSFTNGP04 (DOT) phx.gbl... The database does exist. Thanks for the drive by response. Rob "TheSQLGuru" <kgboles (AT) earthlink (DOT) net> wrote in message news:dI2dnQKbEPA65OfVnZ2dnUVZ_ovinZ2d (AT) earthlink (DOT) com... You cannot connect specifying a database to connect to which does not exist (yet). -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:eoIraDR5IHA.300 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am writing a script to create a database for out application. Currently the app attaches an mdf and ldf, but I don't like that solution. I have a script that creates a database using sqlcmd.exe and I pass variables to it using the -v option. It works fine. When I attempt to run a second script via osql.exe it fails with the following error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I omit the input file, I get the same error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I connect to a database other than the one I just created with the script, it works: C:\>osql.exe -S SERVER -U sa -P password -d ExistingDB 1> quit C:\ I'm at a loss here. I thought the sa account was supreme. Any help would be greatly appreciated. Thanks, Rob |
#42
| |||
| |||
|
|
Uri, The script creates tables and stored procedures. Even if I don't run the script, I can't connect to the database with osql.exe. I am able to access the database with the SQL Management Studio. Rob "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%232zW04W5IHA.3784 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Rob What does CreateDBObjects.sql script do? Can you connect to the NewDB via SSMS? "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:%23NMPnLV5IHA.1200 (AT) TK2MSFTNGP04 (DOT) phx.gbl... The database does exist. Thanks for the drive by response. Rob "TheSQLGuru" <kgboles (AT) earthlink (DOT) net> wrote in message news:dI2dnQKbEPA65OfVnZ2dnUVZ_ovinZ2d (AT) earthlink (DOT) com... You cannot connect specifying a database to connect to which does not exist (yet). -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:eoIraDR5IHA.300 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am writing a script to create a database for out application. Currently the app attaches an mdf and ldf, but I don't like that solution. I have a script that creates a database using sqlcmd.exe and I pass variables to it using the -v option. It works fine. When I attempt to run a second script via osql.exe it fails with the following error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I omit the input file, I get the same error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I connect to a database other than the one I just created with the script, it works: C:\>osql.exe -S SERVER -U sa -P password -d ExistingDB 1> quit C:\ I'm at a loss here. I thought the sa account was supreme. Any help would be greatly appreciated. Thanks, Rob |
#43
| |||
| |||
|
|
Uri, The script creates tables and stored procedures. Even if I don't run the script, I can't connect to the database with osql.exe. I am able to access the database with the SQL Management Studio. Rob "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%232zW04W5IHA.3784 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Rob What does CreateDBObjects.sql script do? Can you connect to the NewDB via SSMS? "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:%23NMPnLV5IHA.1200 (AT) TK2MSFTNGP04 (DOT) phx.gbl... The database does exist. Thanks for the drive by response. Rob "TheSQLGuru" <kgboles (AT) earthlink (DOT) net> wrote in message news:dI2dnQKbEPA65OfVnZ2dnUVZ_ovinZ2d (AT) earthlink (DOT) com... You cannot connect specifying a database to connect to which does not exist (yet). -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:eoIraDR5IHA.300 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am writing a script to create a database for out application. Currently the app attaches an mdf and ldf, but I don't like that solution. I have a script that creates a database using sqlcmd.exe and I pass variables to it using the -v option. It works fine. When I attempt to run a second script via osql.exe it fails with the following error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I omit the input file, I get the same error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I connect to a database other than the one I just created with the script, it works: C:\>osql.exe -S SERVER -U sa -P password -d ExistingDB 1> quit C:\ I'm at a loss here. I thought the sa account was supreme. Any help would be greatly appreciated. Thanks, Rob |
#44
| |||
| |||
|
|
Uri, The script creates tables and stored procedures. Even if I don't run the script, I can't connect to the database with osql.exe. I am able to access the database with the SQL Management Studio. Rob "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%232zW04W5IHA.3784 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Rob What does CreateDBObjects.sql script do? Can you connect to the NewDB via SSMS? "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:%23NMPnLV5IHA.1200 (AT) TK2MSFTNGP04 (DOT) phx.gbl... The database does exist. Thanks for the drive by response. Rob "TheSQLGuru" <kgboles (AT) earthlink (DOT) net> wrote in message news:dI2dnQKbEPA65OfVnZ2dnUVZ_ovinZ2d (AT) earthlink (DOT) com... You cannot connect specifying a database to connect to which does not exist (yet). -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:eoIraDR5IHA.300 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am writing a script to create a database for out application. Currently the app attaches an mdf and ldf, but I don't like that solution. I have a script that creates a database using sqlcmd.exe and I pass variables to it using the -v option. It works fine. When I attempt to run a second script via osql.exe it fails with the following error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I omit the input file, I get the same error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I connect to a database other than the one I just created with the script, it works: C:\>osql.exe -S SERVER -U sa -P password -d ExistingDB 1> quit C:\ I'm at a loss here. I thought the sa account was supreme. Any help would be greatly appreciated. Thanks, Rob |
#45
| |||
| |||
|
|
Uri, The script creates tables and stored procedures. Even if I don't run the script, I can't connect to the database with osql.exe. I am able to access the database with the SQL Management Studio. Rob "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%232zW04W5IHA.3784 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Rob What does CreateDBObjects.sql script do? Can you connect to the NewDB via SSMS? "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:%23NMPnLV5IHA.1200 (AT) TK2MSFTNGP04 (DOT) phx.gbl... The database does exist. Thanks for the drive by response. Rob "TheSQLGuru" <kgboles (AT) earthlink (DOT) net> wrote in message news:dI2dnQKbEPA65OfVnZ2dnUVZ_ovinZ2d (AT) earthlink (DOT) com... You cannot connect specifying a database to connect to which does not exist (yet). -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:eoIraDR5IHA.300 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am writing a script to create a database for out application. Currently the app attaches an mdf and ldf, but I don't like that solution. I have a script that creates a database using sqlcmd.exe and I pass variables to it using the -v option. It works fine. When I attempt to run a second script via osql.exe it fails with the following error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I omit the input file, I get the same error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I connect to a database other than the one I just created with the script, it works: C:\>osql.exe -S SERVER -U sa -P password -d ExistingDB 1> quit C:\ I'm at a loss here. I thought the sa account was supreme. Any help would be greatly appreciated. Thanks, Rob |
#46
| |||
| |||
|
|
Uri, The script creates tables and stored procedures. Even if I don't run the script, I can't connect to the database with osql.exe. I am able to access the database with the SQL Management Studio. Rob "Uri Dimant" <urid (AT) iscar (DOT) co.il> wrote in message news:%232zW04W5IHA.3784 (AT) TK2MSFTNGP06 (DOT) phx.gbl... Rob What does CreateDBObjects.sql script do? Can you connect to the NewDB via SSMS? "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:%23NMPnLV5IHA.1200 (AT) TK2MSFTNGP04 (DOT) phx.gbl... The database does exist. Thanks for the drive by response. Rob "TheSQLGuru" <kgboles (AT) earthlink (DOT) net> wrote in message news:dI2dnQKbEPA65OfVnZ2dnUVZ_ovinZ2d (AT) earthlink (DOT) com... You cannot connect specifying a database to connect to which does not exist (yet). -- Kevin G. Boles Indicium Resources, Inc. SQL Server MVP kgboles a earthlink dt net "Rob Hill" <robh71 (AT) nospam (DOT) nospam> wrote in message news:eoIraDR5IHA.300 (AT) TK2MSFTNGP05 (DOT) phx.gbl... I am writing a script to create a database for out application. Currently the app attaches an mdf and ldf, but I don't like that solution. I have a script that creates a database using sqlcmd.exe and I pass variables to it using the -v option. It works fine. When I attempt to run a second script via osql.exe it fails with the following error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I omit the input file, I get the same error: C:\>osql.exe -S SERVER -U sa -P password -d NewDB -i 2_CreateDBObjects.sql Cannot open database "NewDB" requested by the login. The login failed. If I connect to a database other than the one I just created with the script, it works: C:\>osql.exe -S SERVER -U sa -P password -d ExistingDB 1> quit C:\ I'm at a loss here. I thought the sa account was supreme. Any help would be greatly appreciated. Thanks, Rob |
#47
| |||
| |||
|
|
The database does exist. Thanks for the drive by response. |
#48
| |||
| |||
|
|
The database does exist. Thanks for the drive by response. |
#49
| |||
| |||
|
|
The database does exist. Thanks for the drive by response. |
#50
| |||
| |||
|
|
The database does exist. Thanks for the drive by response. |
![]() |
| Thread Tools | |
| Display Modes | |
| |