|
This page controls how
strict the comparison of stored procedures, triggers, functions and
views should be. Each such entity has a piece of SQL script as its
body and this SQL may (or may not) be equivalent to another piece
of SQL regardless of minor changes in spacing, indentation,
character case or comments. If Lexical
comparison is chosen, the SQL is
converted into a stream of lexical tokens and those are compared.
This is the preferable way.
In this case all SQL
keywords will be case-insensitive and the case-sensitivity of
identifiers will be determined by the "Name comparison" settings
above. If you don't want to have SQL comments compared, they can be
removed from the token stream before the comparison by setting
the Ignore
comments option. When you uncheck
the Lexical
comparison option, the two SQL
definitions will be compared as monolithic strings, together with
spaces, line breaks and all. Still, the case-sensitivity option
would apply in this case, as well.
The Smart
comparison option works only for
expressions, such as those in DEFAULT or CHECK constraints or in
computed columns. The server parses such expressions and tends to
insert extra parenthesis around numeric literals and generally
re-format them before storing in the database. This "smart
comparison" option allows to normalize numeric literals before they
are compared and removes parenthesis around them, so
some
of the minor
changes introduced by server's parsing and reformatting can be
eliminated. It does not solve the problem completely, as
other auto-formatting changes made by the server may involve
adding/removing of optional parameters (e.g. in CONVERT(...)) or of
parenthesis around sub-expressions.
The "Pair
objects with identical code" option allows the Diff
to match stored procedures (or other code objects) that have
different names, but otherwise identical definitions. Such pairing
would only happen when no procedure with matching name is found in
the opposite database. When scripting, the Diff would
synchronize these procedures by renaming them ("exec sp_rename
...").
Ignore
changes in expressions. This option allows to
ignore changes in certain expressions. You don't normally
need this, except for situations when equivalent expressions differ
in minor details (e.g. "(2+3)" vs. (3+2)") and the comparison
algorithm is too stupid to recognize that they are in fact
equivalent. You should always try to use the "[x] Smart
comparison" option before resorting to the "Ignore expressions"
one.
NOTE that although the
comparison settings primarily apply to the schema tree comparison,
some of them also affect the side-by-side textual comparison. In
other words, first of all, they determine if a specific pair of
procedures will be marked in the schema tree as identical or as
changed. When you double-click on this schema item and the
procedures are displayed in the side-by-side comparison window, the
visual comparison will use these settings as follows:
|
·
|
For the
side-by-side view, "Lexical comparison" means that changes in
spaces will be ignored. However, differences like ObjectName
vs. [ObjectName] will still be visible in the side-by-side
view.
|
|
·
|
"Ignore
comments" in the side-by-side mode works the same as in schema
comparison
|
|
·
|
"Case-insensitive" also
works in the side-by-side view
|
|
·
|
"Smart
comparison" is not used in the side-by-side view
|
It is worth to remember
that it is
always the schema comparison that matters, not the side-by-side
view. It is possible to encounter situations when two SQL
entities (such as procedures) may appear identical in the schema
view, but different in the side-by-side comparison, or vice
versa.
|