|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
sql create database path issue
Hi,
I have a vb application, that uses as sql server database, I install an Instance of sql server, using MSDE sp3. The instance name is Nexus, so on a default machine, it should install to c:\Program Files\Microsoft SQL Server\MSSQL$NEXUS\, which is working fine. I also run this query, using Osql afterwards to create a new database in that instance, but the problem is that the path to the data directory, is hard coded, so when a user installs his program files on his D drive for example, the create database statement will fail! Code:
CREATE DATABASE [Nexus_3_0_2] ON (NAME = N'Nexus_3_0_2', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL$NEXUS\Data\Nexus_3_0_2.mdf' , SIZE = 8, FILEGROWTH = 10%) LOG ON (NAME = N'Nexus_3_0_2_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL$NEXUS\Data\Nexus_3_0_2_log.ldf' , FILEGROWTH = 10%) GO is there any way to do the part in red, with out using a physical path, but still specifying it to go the the MSSQL$NEXUS\ folder? Any ideas and references is appreciated. Thanx in advance. noFriends
__________________
Look! Its a ShemZilla ![]() ![]()
|
|
#2
|
|||
|
|||
|
Is there a good reason it has to be on MSSQL$NEXUS folder. Also, can you run the SQL database creation script from a VB app? Then you can make a nice little front end and make the user choose what directories they want to use and run the database creation script from the VB app.
Also, assuming that everything is on the same path/drive might be incorrect. In our case, we make the data stay on one drive and indexes on another drive and the log file on a third. So you could make the user specify where they want all three of them and default them to the same location.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. |
|
#3
|
||||
|
||||
|
yes there is
![]() because some of the users already have sql server installed on their machines, and we would like the whole instance to be seperate from existing servers, and the client application uses the nexus instance to connect to, any ideas? |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > sql create database path issue |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|