DB restored from customer -> Database diagram vanishes

  • Hello,

    I use SS2008R2 Dev.Edition and altered a DB from my customer. Then I send him my DB-backup, the customer synchronizes the db-schema with SQLCompare. So far, so good. All works. Now the customers production DB is sent back to me and I restored this one. But the Database diagram I created has vanished.:w00t:

    I suppose that has to do with user rights.

    At my PC I always login as user with sysadmin rights/windows security. The customer uses windows security AND some SQL User logins and I think thats the issue.

    Whats the right way to assure that any DB-backup I receive from my customer also returns the Database diagram?

    thx

    --
    candide
    ________Panta rhei

  • Only owner who created db diagrams can see his own diagrams, and db_owner/sysadmin can see all diagrams (created by any user) in the db.

    Log on as sysadmin and query dbo.sysdiagrams to see did they really dissapear. It is part of the db backup, so backup/restore will not erase it.

    Check the diagram owners:

    select d.*, p.name

    from dbo.sysdiagrams d

    left join sys.database_principals p on p.principal_id = d.principal_id

    _____________________________________________________
    Microsoft Certified Master: SQL Server 2008
    XDetails Addin - for SQL Developers
    blog.sqlxdetails.com - Transaction log myths
  • I think you will find that the problem really is that diagram are created in the table sysdiagrams. Unless the customer copied the data in this table from the database you sent into their own database when they synchronised the 2 databases, then the diagram simply does not exist (in your customer's database).

    If the object id's happen to be the same, you could try copying the diagram from your database into the database the customer sent you. Strictly speaking this isn't supported by MS but it does work if the ID's match. If not, you will get warnings about tables, that were on the diagram, have been deleted and will be removed from the diagram. What you will be left with is a diagram that is the diagramming tool's best effort at showing what is in the diagram.

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

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