Database Physical File Location


Author
Message
Tim Dol
Tim Dol
StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)StrataFrame User (368 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
I am using a separate database for the role based security files and when I deploy for the first time it automatically creates the physical database files in a default folder. We have customers that implement policies for the physical location of database files. Is there any way to specify the folder location if the database does not exist? I basically use your standard deployment routines, which I have wrapped for customer use, so does your standard deployment routine currently support this?.

Tim

Replies
StrataFrame Team
S
StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)StrataFrame Developer (3.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
There is not a place within the DatabaseMigrator to allow you to specify the exact path for the file when it is created.  The code looks like this:

If _SQLServer.Settings.DefaultFile.Length > 0 Then
    lcReturn = _SQLServer.Settings.DefaultFile
Else
    lcReturn = _SQLServer.Information.MasterDBPath
End If

The _SQLServer is a Microsoft.SqlServer.Management.Smo.Server object.  The Settings.DefaultFile is the default location for the data set by the install of SQL Server.  The Information.MasterDbPath is the path that you can specify within the server properties in SQL Server Management Studio.  So, it always places the .mdf files within the default database location.  If you need to change that, you'll need to change the source code.  In the DatabaseMigrator class, it's either going to be the GetDataFilePath() method or the CreateSmoDataFile() method.

ChanKK
ChanKK
StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,

Shall we enhance this method so that can be overridable?



Please reply so that we could know what should be done next.



Thank you
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search