Posted by rod.weir on 04/03/06 05:13
Hi Dan,
Many thanks for your response. This code does exactly what I'm after.
It skipped over the bad queries and kept refreshing the good ones. I
modified the following line to speed it up a little bit.
EXEC ('SET FMTONLY ON SELECT * FROM ' + @DatabaseObject + 'Where 1=0')
Notice the Where 1 = 0 clause? Much quicker now.
Thanks Dan and Erland. Problem solved.
p.s. Erland. I am going to start another thread on the evils of
embedded queries. I have heard a lot of people say that this is a bad
practice, however I've never heard any really compelling evidence to
say why.
Navigation:
[Reply to this message]
|