How can we help you today? How can we help you today?

FEATURE REQUEST: Add a USE DB_NAME statement

I have needed to manually add in
USE DB_NAME
GO

to the beginning of the script generated by SQL Compare 6/7
so that when QA runs in the production he doesn't need to manually switch the database first; also ensures we run the script in the correct DB

This is the script SQL Compare 7 saved this morning
/*
Script created by SQL Compare version 7.0.0 from Red Gate Software Ltd at 4/8/2008 9:55:04 AM
Run this script on SERVER2.DB_NAME to make it the same as SERVER1.DB_NAME
Please back up your database before running this script
*/

I modified it this way
USE DB_NAME
GO

/*
Script created by SQL Compare version 7.0.0 from Red Gate Software Ltd at 4/8/2008 9:55:04 AM
Run this script on SERVER2.DB_NAME to make it the same as SERVER1.DB_NAME
Please back up your database before running this script
*/
jerryhung
0

Comments

6 comments

  • Michelle T
    I've added this forum topic to the feature request for this feature.

    One concern that we have with implementing this feature is that some people take the synchronization script and use it on multiple databases (especially databases on various customer sites) which might have different names. This is the reason we haven't just added it already - we're trying to work out if enough customers work in this way that it's worth supporting (and we should add this feature as an option rather than just the way things are) or whether we should just add the USE statement and have them take it out manually if necessary (which might be awkward as they tend to be the people who use heavily automated deployment systems).
    Michelle T
    0
  • jerryhung
    I understand your logic completely

    I would prefer it to be an OPTION as well instead of by default

    Thanks for considering it
    jerryhung
    0
  • jimboh
    When you use backups (which retain the target meta) rather than restoring to a local or aliased database for the comparison, then the USE statement option would certainly be appropriate.

    jimboh
    jimboh
    0
  • tbrovold
    I totally agree with the idea of adding the Use statement as an Option and not the default exactly for the reason mentioned. We have multiple servers and in many cases the database name is the same but in some cases the database name is different or there are differnet versions of the same database on one server and having a USE statement might cause problems.

    Thanks
    tbrovold
    0
  • Andras B
    Many thanks for all your comments. We have now added an option to add a use statement at the beginning of a script generated by SQL Compare 7. This option will be off by default.
    Regards,
    Andras
    Andras B
    0
  • jerryhung
    Andras wrote:
    Many thanks for all your comments. We have now added an option to add a use statement at the beginning of a script generated by SQL Compare 7. This option will be off by default.
    Regards,
    Andras

    THANK YOU
    jerryhung
    0

Add comment

Please sign in to leave a comment.