Top 10 SQL Compare Tips. Watch now.

Can sql compare force a set of indexes on a table, no matter what indexes were there before

davidfdavidf Posts: 8 New member
updating my customers (police forces) is a one way street, it is not possible to get them to reliably send me  information or to run snapper so i can compare the databases.  They also have a habit of creating their own indexes.   Can i create an update script that will ensure that only my indexes will exist for a table, and delete ANY other index that may exist?   A sort of "blind" update?

Answers

  • Hello @davidf,

    Unfortunately, you can't filter on index differences on SQL Compare. It has to be done on a table level since the indexes are part of the table. If you are okay with deploying all table differences (which would include the indexes), you can deploy "source only" and "in both but different" differences.

    Kind regards,
    David David
    Product Support Engineer
  • davidfdavidf Posts: 8 New member
    Hi david thanks for responding.   I understand what u say but my question is different.  i need an option called "force exclusivity" or something like that....   This is my desired use case:
    1. Customer makes a mess of one of my table structure by adding junk indexes but refuses to send a sql compare snapper schema for comparison.
    2. the table cannot be dropped and recreated because it has data.
    3. i create a script with sql compare of how the table should look exactly.
    4. i send the script to the customer, and after he has run it, the table is exactly as i want it to be, without his junk indexes  i.e.  the sql compare deployment script deleted any junk the customer may have added to the table.
  • David_DDavid_D Posts: 21 Bronze 2
    edited October 23, 2020 6:37PM
    Hi @davidf

    SQL Compare can only create deployment scripts using a source against a target. If you are able to run a comparison between your database (source) and your customer's database (target), then you should be able to create a deployment script that will replace what your customers may have added to the table.

    I hope this answer helps you out! Don't hesitate to let me know if you have any other questions.

    Kind regards,
    David Dang
  • davidfdavidf Posts: 8 New member
    hi @David_D
    i have another question, if i have an index on a view that needs to be created on an existing view, why does the view have to be dropped in its entirely?  this is a problem for me because if the index already exists then nothing should be done (and save the customer upgrade time).  is there not a setting to not drop views and just add an index if it doesnt exist?
    david
  • Hello @davidf,

    Thanks for your question. Depending on the operations that are being performed by the script we may need to drop and recreate indexes or constraints. If you can provide an example, I may be able to provide more information on why specifically in your case this is occurring.

    Thank you,
    David Dang
    Product Support Engineer
Sign In or Register to comment.