SQL 2012 SSMS Generated Scripts

  • Hi All,

    Background.

    I am using 64 bit SQL 2012 Developer Edition RTM (SQL Engine and SSMS) on 64 Bit Windows 20088R2.

    The subject database is in production in SQL 2008R2. We are testing it on a dev server in SQL 2012 with a view to migrating.

    When I try to generate a script using SSMS 2012 on the Dev server

    i.e. [Object Explorer ->Right Click -> Script <object> -> Create To -> New Query window.]

    the generated script contains any number of objects in addition to the one I have selected. It frequently takes a very long time to generate the script and typically it will actually report generation errors like could not resolve object reference.

    By contrast, using SQL 2008R2 the same object script will generate quickly and cleanly.

    For example, generating a script for a Stored Procedure results in a script containing the desired procedure, 3 unrelated functions, a couple of dozen tables including some from other schemas, and several unrelated triggers. Several "error messages" appear at the top of the script for a couple of different items. Here is an example.

    "/****** Cannot script Unresolved Entities : Server[@Name='xxx-xxx-01']/Database[@Name='xxxxxx']/UnresolvedEntity[@Name='StateTimeZone'] ******/"

    The entity 'StateTimeZone' does not exist in the database so I understand that part however the entity is not referenced in the procedure I am trying to script.

    I see similar results when I try to script a view.

    Any hints or clues?

  • Under the Tools>Options menu, you have 'script dependent objects' turned on, I think.


    And then again, I might be wrong ...
    David Webb

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply