Skip to content

Settings and activity

2 results found

  1. 33 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    5 comments  ·  SQL Search  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    Anonymous commented  · 

    Script search result (selected or otherwise) to a single drop and create script would help a lot. with dependency order in mind of-course :)

    Anonymous supported this idea  · 
  2. 530 votes
    Vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    You have left! (?) (thinking…)
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    under review  ·  Kendra responded

    Thanks for this suggestion and for the many comments and upvotes. I realize that this is a pain point.

    I have a few shorter-term workarounds to summarize as well as some information on the longer roadmap in this update. I know these shorter-term workarounds aren’t perfect (I summarize the pros and cons), but I’m posting them as they may help a few folks.

    Workaround 1) When data changes to static data need to be made, use a “relink the table” pattern
    One can “cleanly rescript” a static data table in SQL Source Control by:

    • Unlinking the static data table
    • Committing
    • Relinking the static data table
    • Committing

    Pro: This works with the GUI and requires no special knowledge or comfort with TSQL. This may help folks with just a few static data tables.
    Con: This requires extra steps and results in extra commits in the history, which I realize can…

    An error occurred while saving the comment
    Anonymous commented  · 

    this would serve as a good migration example... deleting statics my no be possible if they are in any way connected by key constraints when reverting to and older version but. update and add if missing would work i think. any column drop warnings could also then be omitted on version-controlled static data-tables when reverting back :)

    MERGE #Item AS TARGET
    USING #ItemSource AS SOURCE
    ON ( TARGET.Id = SOURCE.Id )
    WHEN MATCHED THEN
    UPDATE SET TARGET.Name = SOURCE.Name ,
    TARGET.Something = SOURCE.Something
    WHEN NOT MATCHED THEN
    INSERT ( Id, Name, Something )
    VALUES ( SOURCE.Id ,
    SOURCE.Name ,
    SOURCE.Something
    );

    Anonymous supported this idea  ·