Results 1 to 2 of 2
  1. #1
    Join Date
    May 2016

    Unanswered: Issue while creating same existing DB schema in a new Database


    I have generated Scripts of an existing DB structure using Ms Sql generate scripts feature.

    When I execute the same script in a new blank DB , I get many dependency errors.

    can we create a schema script from an existing DB , so that when we run no dependency errors occur ?
    if yes please let me know the procedure.

    I have already made dependency objects option to true while creating the script.


  2. #2
    Join Date
    Nov 2004
    Provided Answers: 4
    Quote Originally Posted by shru View Post
    I get many dependency errors.
    Schema, that means DDL scripts.

    If in DDL, rearrange your scripts, so the CREATE TABLE scripts are on top of the file, before the Foreign key Constraints.

    If in DML, rearrange your script so the INSERT INTO statements of code tables and parent tables appear before the tables that have references to those tables.
    Last edited by Wim; 05-28-16 at 06:18.
    With kind regards . . . . . SQL Server 2000/2005/2012

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts