• lancebeacroft (3/28/2011)


    Sorry, but I am not happy with this solution at all.

    My view is that any changes to procedures must be auditable. therefore, first off I would have identified the procedures that had @@identity.

    I'm of a similar mindset.

    Visual Studio's 'Replace in Files' command could be used to replace @@IDENTITY with SCOPE_IDENTITY() across all of the relevant script files, then use Red-Gate SQL Compare to compare the 'before' and 'after' script files to generate synchronisation scripts.

    Much less risky IMHO, plus you will also capture occurrences of @@IDENTITY in any objects encrypted in the database.

    Chris