Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Fail to run sql script through osql

Author  Topic 

accesser2003
Starting Member

14 Posts

Posted - 2007-08-08 : 07:02:20
I have installed the MSDE 2000A through the command prompt.
I made it as follow:

c:\> setup INSTANCENAME="AMDESKINSTANCE" SAPWD="AStrongSAPwd" DISBALENETWORKPROTOCOLS=0

The instance created successfully.
The sql script file which generated automatically to create the database called AMD is located as C:\AMDScript.sql.

This sql script file generated automatically from MS SQL Server enterprise 2000, which has the same database name: AMD.

The problem I am facing is that I want to run the sql script file on the instance I created to create this database, so I no longer need to use the MS SQL Server2000, which is not FREE.

To do this I connected through the command prompt into the instance , the result was as follow:

C:\> osql -E -S AMD\AMDESKINSTANCE
1> osql -E -i c:\amdscript.sql
2> go
Msg 170, Level 15, State 1, Server AMD\AMDESKINSTANCE,Line 1
Line 1:Incorrect syntax near 'E'


So What is the problem, and why the script is not run.

Thanks,

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-08 : 14:28:13
Should run this in dos:

osql -E -S AMD\AMDESKINSTANCE -i c:\amdscript.sql
Go to Top of Page

accesser2003
Starting Member

14 Posts

Posted - 2007-08-09 : 05:55:14
Thanks rmiao. I run it, I think it works. the results was as follow:



1> 2> 3> 4> Deleting database file 'C:\Program Files\Microsoft SQL
Server\MSSQL\data\AMDB_Log.LDF'.
Deleting database file 'C:\Program Files\Microsoft SQL
Server\MSSQL\data\AMDB_Data.MDF'.
1> 2> 3> The CREATE DATABASE process is allocating 596.00 MB on disk
'AMDB_Data'.
The CREATE DATABASE process is allocating 1082.00 MB on disk
'AMDB_Log'.
1> 2> 3>



Two files created in the folder: c:\MSDE
1) AMDB_Data
2) AMDB_Log

My question is that the AMDB data base doesnt appear when I am trying to connect through the ODBC. Does that because that the AMDB is not created on the default instance? Can the instance host more than one database?
How can I detect the name of the default instance?

Thanks
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-09 : 23:12:16
Did you see the db in em?
Go to Top of Page
   

- Advertisement -