Options

excluding #temp tables from comparison via scripts

rchanrchan Posts: 11
I am evaluating SQL Compare at the moment, and am trying to compare scripts in a folder to a database.

We have many stored procedures, and developers often create and temp tables within the stored procedures, but don't drop them afterwards. This causes SQL Compare to report all the tables -- is there a way to ignore them in the SQL Compare?

Ultimately, I would like to automate the scripting and synchronization, so I would need a means to filter out all the tables, e.g. that begin with #MyTempTable

Thanks

Comments

  • Options
    Hi,

    If you're using the API, there is a Selected property on each Difference in the Differences collection returned by Database.CompareWith. You can use a regex to exclude the temp tables.

    Aidan
  • Options
    Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    As fas as I'm aware, tables that begin with a hash (#) are always created in the TEMPDB database as opposed to the database you've registered and compared, so I'm not sure how all of the tables in the databases you're comparing would show up differently. Is this more about the stored procedures showing up differently?
Sign In or Register to comment.