getting the objects in dependancy order is pretty easy;
here is an example:
CREATE TABLE #MyObjectHierarchy
(
HID int identity(1,1) not null primary key,
ObjectId int,
TYPE int,OBJECTTYPE AS CASE
WHEN TYPE = 1 THEN 'FUNCTION'
WHEN TYPE = 4 THEN 'VIEW'
WHEN TYPE = 8 THEN 'TABLE'
WHEN TYPE = 16 THEN 'PROCEDURE'
WHEN TYPE =128 THEN 'RULE'
ELSE ''
END,
ONAME varchar(255),
OOWNER varchar(255),
SEQ int
)
--our list of objects in dependency order
INSERT #MyObjectHierarchy (TYPE,ONAME,OOWNER,SEQ)
EXEC sp_msdependencies @intrans = 1
select * from #MyObjectHierarchy
i use that along with a script contribution i made to export all DDL schema into a table in TSQL; kind of handy for having a snapshot of the schema on a daily/weekly basis, makes it simple to compare and all that...
does the above help you at all?
Lowell