dbTalk Databases Forums  

Workaround for DTS ignoring view dependencies in views

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Workaround for DTS ignoring view dependencies in views in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
neilx
 
Posts: n/a

Default Workaround for DTS ignoring view dependencies in views - 11-05-2006 , 05:30 AM






I have been getting lots of crashes in a DTS copy objects package where
it is trying to create an view that depends upon a not-yet-created
view. This could be because the alphabetical order of the names is
reversed as I have seen mentioned on this newsgroup before. (Note: I
always include dependencies in this package, so clearly the DTS
dependency checker isn't foolproof or only checks for table
dependencies)

However, if I drop and recreate the view (the one that crashed, not the
view that it depends on) then DTS works fine on the next run. This
means that DTS is using the last modified date or date created of views
as a sort where it doesn't determine the right order to create them
from its own dependency check. By recreating the view, it seems that
DTS delays its creation until after the earlier dated view it depends
on. (This doesn't work with functions that use views, just with views
that use views)

If this is the case, and assuming that MS won't bother to fix this,
then it would be useful to run through the views automatically and
change the dates accordingly as the first task in the package. Does
anyone know of a tool that could do this?

Neil


Reply With Quote
  #2  
Old   
neilx
 
Posts: n/a

Default Re: Workaround for DTS ignoring view dependencies in views - 11-07-2006 , 08:38 AM






neilx wrote:

Quote:
then it would be useful to run through the views automatically and
change the dates accordingly as the first task in the package. Does
anyone know of a tool that could do this?
Found one. I can use SQL-DMO in a VB .exe and output a view creation
script in the correct order to be used in Query Analyser. This seems to
work great with Views.

(See
http://www.ftponline.com/archives/pr...9/jf0109-3.asp
for an article describing how to do this)

It is a real shame that DTS doesn't check dependencies as thoroughly as
it could as it makes the simplest of tasks - copying objects - a
nightmare.

This is as a result of views and functions being created and altered
over the years without any realisation of the implications of (not)
ordering by date and alphabetical order. Does SSIS have the same
problem?

Neil



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.