Workaround to include tbl triggers w/o including the tbl?

sgilboysgilboy Posts: 41
Is there any sort of way using filters or SQL Source Control configuration that I can include triggers I have created for tables without having to include the tables themselves in the Source Control mix?

Comments

  • James BJames B Posts: 1,124 Silver 4
    Hi,
    Unfortunately, triggers are scripted alongside the table they relate to, so this isn't really possible.
    What's the reasoning behind not wanting the table script? There may be a problem here that can be solved another way.

    Our tools are designed to work with a set of scripts that, all together, represent a valid database. If you omitted various objects then it could lead to unpredictable behaviour/errors.
    Systems Software Engineer

    Redgate Software

  • Hi,
    Unfortunately, triggers are scripted alongside the table they relate to, so this isn't really possible.
    What's the reasoning behind not wanting the table script? There may be a problem here that can be solved another way.

    Our tools are designed to work with a set of scripts that, all together, represent a valid database. If you omitted various objects then it could lead to unpredictable behaviour/errors.

    mainly because SQL Source control *constantly* seems to want to check tables in for changes, even when it appears nothing was done.....

    this was the case long ago when we first started using it though (back in 2010 i think)
  • James BJames B Posts: 1,124 Silver 4
    It shouldn't want to check in objects that don't have any differences. There were the odd bugs that did make it behave like this though, are you on the latest version?

    If you're seeing a table show on the commit tab but there's no difference at all, then it would be useful to get a copy of both the definition from SSMS and also the related file from your repository so we can work out why it's being picked up.
    Systems Software Engineer

    Redgate Software

  • Yeah, the prob with tables was many many versions ago

    we are on 3.4.4.36 now... maybe I should give it another go-around...
  • James BJames B Posts: 1,124 Silver 4
    Sure - do post back if you're seeing anything weird with identical objects being flagged as different though!
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.