How can we help you today? How can we help you today?

SQL Compare Objects referencing Objects

I am trying to build a script for a database using SQL compare 9.

We are running in to issues where Stored Procedures and Views are referencing other objects that have not been created yet by the SQL Compare so the entire compare is failing.

Is there a way to get the compare to generate in an order that will build the dependency items first then deploy the calling object.

For example I have this error:
The following error message was returned from the SQL Server:

[208] Invalid object name 'vSubView'.

The following SQL command caused the error:

CREATE VIEW dbo.vMainView
AS
SELECT  a.* 
FROM	vSubView A
		INNER JOIN (SELECT	DISTINCT b.[Source] FROM	vSubView b 
				    WHERE	b._updated = (SELECT Max(c._updated) LastUpdated FROM vSubView c)) d
		 ON a.Source = d.Source

It appears that vMainView is being created before vSubView.
gbargsley
0

Comments

3 comments

  • Brian Donahue
    Hi Garry,

    We already have a support call open for this and are dealing with you via email. (I need to put this on the forum to prevent a second support call being raised for the same thing.)
    Brian Donahue
    0
  • kfalconer
    Hi Brian,

    I am having this same issue described by gbargsley. Is there a standard approach to handling object dependencies using SQL Compare 9?

    Thanks,
    Karl
    kfalconer
    0
  • Brian Donahue
    Hi Karl,

    Again, I recommend you email Red Gate support directly. It's supposed to "just work".
    Brian Donahue
    0

Add comment

Please sign in to leave a comment.