"John Bell" wrote ...
[quoted text, click to view] > I am not sure why you are scripting and creating views in a DTS job? The
> order is probably alphabetical and assuming that you are dropping the
views
> (singularly) before creating each view, you could probably run the script
> twice which may result in no errors.
Hi John,
I probably didn't explain myself very clearly - sorry - the procedure I
carried out initially was to perform an import from a remote SQL Server to
my own. As I went through the wizard at the end it asks you if you would
like to schedule it / save it - so I did, this in turn then created a DTS
package and a scheduled job for me.
When I look at the dts I can open it up and it basically gives me the import
wizard screen again where I can set all of the objects to import and so on.
On the window for the wizard at the bottom there's a field for the 'script
directory' - I hadn't ever changed this or done anything with it - but when
I looked in this directory there were lots of files, and having removed them
all and run the dts again - they all re-appeared - so its obviously creating
these files, then executing the scripts to do the import (I'm assuming).
I didn't check to see if it was doing them alphabetically, but have got
around the problem for now by splitting it all into pieces...the first dts
gets the tables and stored procedures, the second gets the 1 view which
needs to be done before one of the others, then the last dts gets all of the
rest of the views. All wrapped up in one job that fires them off one after
the other...its working, but just feels like it could have been achieved
better...I could of obviously changed the view which is dependant on the
other view to use a load of joins instead to achieve the same result, but
that seemed like for more work that was warranted....
Regards
Rob