StrataFrame Forum
Back
Login
Login
Home
»
.NET Forums
»
General .NET Discussion
»
Design question
Design question
Post Reply
Like
0
Prev
1
2
Jump To Page
Design question
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Trent Taylor
Trent Taylor
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
You will just do this at deployment time through the DatabaseMigrator class. You can see a sample of this in the sample titled "Database Installer" through the sample console. Below is some code showing how to use a different database name while using the same package file. Be sure that your data file in your file group uses the $DbName$ tag within the DDT itself so it can create a proper file name for each database on the server....otherwise you will get an error because the file name for the file group is already in use.
Dim loDatabase As New DatabaseTargetName("MyProfileDBName")
loDatabase.NameOnServer = "MyProfileDBName_One"
_DatabaseSetup.DeployMetaData(PackageFilePathandFileName, New DatabaseTargetName() {loDatabase})
loDatabase.NameOnServer = "MyProfileDBName_Two"
_DatabaseSetup.DeployMetaData(PackageFilePathandFileName, New DatabaseTargetName() {loDatabase})
loDatabase.NameOnServer = "MyProfileDBName_Three"
_DatabaseSetup.DeployMetaData(PackageFilePathandFileName, New DatabaseTargetName() {loDatabase})
Reply
Like
0
Greg McGuffey
Greg McGuffey
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 2K,
Visits: 6.6K
So what might be cool is to do this in a console app, and pass in the db name
' Main sub of a deployment console app named 'DeployDb'
Sub Main(args() As String)
'-- First argument is package path and second is database name
Dim loPackageFile As String = args(0)
Dim loDataBaseName As String = args(1)
Dim loDatabase As New DatabaseTargetName(loDataBaseName )
loDatabase.NameOnServer = "MyProfileDBName_One"
_DatabaseSetup.DeployMetaData(loPackageFile , New DatabaseTargetName() {loDatabase})
End Sub
Then you could create a batch file to update all the databases easily, even build it into the build script in VS.
:: In batch file
DeployDb "c:\data\myPackage.pkg","companyA_DbName"
DeployDb "c:\data\myPackage.pkg","companyB_DbName"
DeployDb "c:\data\myPackage.pkg","companyC_DbName"
Reply
Like
0
Ben Hayat
Ben Hayat
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 374,
Visits: 1.2K
Greg McGuffey (07/05/2007)
So what might be cool is to do this in a console app, and pass in the db name
' Main sub of a deployment console app named 'DeployDb'
Sub Main(args() As String)
'-- First argument is package path and second is database name
Dim loPackageFile As String = args(0)
Dim loDataBaseName As String = args(1)
Dim loDatabase As New DatabaseTargetName(loDataBaseName )
loDatabase.NameOnServer = "MyProfileDBName_One"
_DatabaseSetup.DeployMetaData(loPackageFile , New DatabaseTargetName() {loDatabase})
End Sub
Then you could create a batch file to update all the databases easily, even build it into the build script in VS.
:: In batch file
DeployDb "c:\data\myPackage.pkg","companyA_DbName"
DeployDb "c:\data\myPackage.pkg","companyB_DbName"
DeployDb "c:\data\myPackage.pkg","companyC_DbName"
Greg, I think you just earned your "Advance SF User" title!
..ßen
Reply
Like
0
Keith Chisarik
Keith Chisarik
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 939,
Visits: 40K
where would you tell it what SQL server/security information to use?
Keith Chisarik
Sigma Data Systems
Reply
Like
0
Keith Chisarik
Keith Chisarik
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Users
Posts: 939,
Visits: 40K
found it.....
Keith Chisarik
Sigma Data Systems
Reply
Like
0
Trent Taylor
Trent Taylor
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
When you create the DatabaseMigrator class you provide the SQL server and authentication information.
_DatabaseSetup = New DatabaseMigrator(_SQLServer, False, Me, _SQLUserName, _SQLPassword)
Reply
Like
0
Trent Taylor
Trent Taylor
posted 17 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
Keith....I'm guessing you saw Transformers
Great movie!!!
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
0
Prev
1
2
Jump To Page
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search