SQL Compare Objects referencing Objects

gbargsleygbargsley Posts: 34 Bronze 4
edited September 13, 2011 8:34AM in SQL Compare Previous Versions
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.

Comments

Sign In or Register to comment.