When deploying databases using Db Pro the scripts which are executed have a database context. Visual Studio will automatically include a 'USE [YourDbName]' where YourDbName is taken from the project's BUILD property. This is the context for the scripts to execute. This is important because if you change it in any of the scripts it can mess with your deployment. For example, you create a script called 'AgentJobs.sql' in the Post-Deployment folder and add a reference to the script in Script.PostDeployment.sql. This means your AgentJobs script will be executed when you do a deployment. Now assuming you add a 'USE MSDB' statement in the script, your deployment runs successfully HOWEVER any scripts which execute after AgentJobs eg Data.sql (it executes in alphabetical order) will now have MSDB as the context rather than [YourDbName] as expected. So make sure that you use fully qualified references to objects in other databases and DON'T use 'USE'!
Tuesday, 8 January 2008
VS Db Pro – Script Deployment - Database Context
Posted by
Kristen Hodges
at
4:22 pm
0
comments
Labels: SQL, Visual Studio Db Pro (DataDude)
Monday, 25 June 2007
Visual Studio Db Pro (DataDude) Headaches
So, no question, Db Pro is a great tool. However, it is not without it's headaches.
When working with TFS and multiple team members, we have had no end of synching problems and regular out of memory errors. This only seems to occur when multiple users are working on the same Db Pro project.
As you can imagine, this has added to development time on projects... ok not hugely but certainly a day or maybe two in terms of charge-able hours and in terms of developer frustration and tense working environment!
My advice to you would be keep it to single user projects where possible... if not, maybe wait for SP1 or Orcas before switching to DataDude.
Posted by
Kristen Hodges
at
9:44 am
0
comments
Labels: SQL, Visual Studio Db Pro (DataDude)
Monday, 18 June 2007
BUG REPORT: VS Db Pro - TFS - Get Latest Version doesn't update error list
When using Visual Studio Database Professional (DataDude) and Team Foundation Server there are synching problems between team members when using "Get Latest Version" - the error list does not update to reflect changes. Allow me to give you an example:
- DeveloperA deletes TableA and checks in. At this point, StoredProcA is in error because it depends on DatabaseObjectA - this is shown in DeveloperA's error list in Visual Studio.
- DeveloperB does "Get Latest Version" on the project
- DeveloperB corrects StoredProcA and checks in.
- DeveloperA does "Get Latest Version" on the project
Have logged it with Microsoft Connect... you can view/watch it at https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=285730
******************************** UPDATE ********************************
This is the response from Microsoft.
Unfortunately, this is expected behavior. The database project doesn't know when all of the files have finished being updated, so it doesn't know when to refresh itself. When the project is in this situation, there is an information message in the info strip at the top of schema view telling you that you need to refresh. You can refresh the project one of these ways: . do a refresh on the solution explorer (button on the toolbar of solution explorer) . open the file that was modified . build . close/reopen the project
Posted by
Kristen Hodges
at
4:12 pm
1 comments
Labels: Bug, TFS, Visual Studio Db Pro (DataDude)
FEATURE REQUEST: VS DbPro - Refactor/Delete function
I've suggested this should be a prompted action whenever you do a schema view delete... and if the action is not carried out, then all affected items should be flagged.
If you've hit this little nugget of joy, please vote for the feature request...
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=285727
************** UPDATE FROM MICROSOFT **************
This is a good suggestion, thank you for your feedback. We are considering your suggestion for future release.
Posted by Microsoft on 22/08/2007 at 9:45 AM
Posted by Microsoft on 8/22/2007 at 9:45 AM
I agree that a cascading delete would be far too heavy-handed. An excellent solution would be something similar to a 'schema compare'.
Posted by khodges on 8/29/2007 at 5:33 PM
Posted by
Kristen Hodges
at
1:15 pm
2
comments
Labels: Visual Studio Db Pro (DataDude)
