Database name (local/remote)


Author
Message
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I have questions as below:



1. How could I allow user to decide database name during DDT deployment?

2. I have some view that join tables from local and remote database. The remote database name could be vary among customer even though it is has the same structure. How could I tell DDT at runtime so that it will "change" my view defination to map to the remote database?



Please advice.



Thank you
Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yeah, that is not a bad idea on the dummy database.  When you pick the database to execute in the Pre/Post script, it will execute on the renamed database.  So if the remote database name was Chan and they entered Chan_New, then it would execute that script on Chan_New.

All of this is giving me an idea for an enhancement which would be the introduction of profile variables that you could place within your sproc code and then those variables would be replaced at the time of deployment with the value you give it.  This is actually a really good idea and would be a good application for this very thing.  The bad part is that it isn't there yet Sad since the idea just came to me.  But I will add this to the list and this is something that will most likely make it into the DDT.  Good idea, Chan.

Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

I would like to add-on is that, I found that profile script only support T-SQL, is it? Any possible to place .NET code?



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, if you want to implement .NET, code, then I suggest creating a CLR stored procedure.  This is what the CLR stored procedures are designed for and can make doing certain things much easier versus doing it all in T-SQL code.
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

Hmmm... the reason to use .NET code in my case is not to execute something at SQL Server. Instead, during DDT deployment process. In order words, I would like to have custom logic during deployment database.



Any ideas?



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, at this point there is not anything like that from directly within the DDT.  That is why this thread was filled with some good ideas to use DDT variables (which don't presently exist) so that you can manipulate this at the time of deployment and add your own logic.  There are a lot of good ideas here.  However, at the moment, you could still create a CLR sproc that is deployed using the standard DDT logic and then executed as a post deployment script.  You could then use that CLR sproc to update any other elements that need updating.
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Trent L. Taylor (01/22/2009)
Yeah, that is not a bad idea on the dummy database. When you pick the database to execute in the Pre/Post script, it will execute on the renamed database. So if the remote database name was Chan and they entered Chan_New, then it would execute that script on Chan_New.



All of this is giving me an idea for an enhancement which would be the introduction of profile variables that you could place within your sproc code and then those variables would be replaced at the time of deployment with the value you give it. This is actually a really good idea and would be a good application for this very thing. The bad part is that it isn't there yet Sad since the idea just came to me. But I will add this to the list and this is something that will most likely make it into the DDT. Good idea, Chan.




Hi,

Just would like to add-on, this enhancement should not only add to pre/post profile script. Instead, it would be great if this logic can be apply to stored proc/view/trigger/udf and etc as well.



Thank you
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Chan - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Chan - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Chan - 16 Years Ago
                         That could be more difficult. I would probably create a view that is...
Trent L. Taylor - 16 Years Ago
                             Hi,
Is it possible to access DatabaseMigrator property within...
Chan - 16 Years Ago
                                 Yeah, that is not a bad idea on the dummy database. When you pick the...
Trent L. Taylor - 16 Years Ago
                                     Hi,
I would like to add-on is that, I found that profile script...
Chan - 16 Years Ago
                                         Well, if you want to implement .NET, code, then I suggest creating a...
Trent L. Taylor - 16 Years Ago
                                             Hi,
Hmmm... the reason to use .NET code in my case is not to...
Chan - 16 Years Ago
                                                 Well, at this point there is not anything like that from directly...
Trent L. Taylor - 16 Years Ago
                                     [quote][b]Trent L. Taylor (01/22/2009)[/b][hr]Yeah, that is not a bad...
Chan - 16 Years Ago
Keith Chisarik - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search