My requirement to capture SQL Query time out in SQL statement and run continues loop till query not successful.
Step.1 Run loop.
Step.2 Run loop Query (DBCC Shrink).
Step.3 If shrink command through timeout error run again till not successful.
As I know shrink command not rollback so whatever is complete that will be remain available so next time when we again shrink it will take less time to shrink database that’s why I want to loop this process.
I cannot increase remote query time out due to some reasons.Please help me to find timeout exception in SQL QUERY 2000 and run loop.
asked Sep 12 '11 at 12:38 AM in Default
You're running a loop of DBCC shrinks from a client app? Is there a particular reason you dislike your database server and your data consumers?
If you're running out of space, it's time to go and buy a hard drive. Unless we're talking SSD's in some type of RAID array, disks are dirt cheap. There's no reason to not add one to deal with space issues. I've got a 2TB external drive sitting on my desktop that cost me $90. You can get more space.If you are dealing with out of control log files, look to your Recovery Model and the frequency of your log backups. If tempdb is growing out of control, you need to look to the processes that are causing it. Shrinking your databases over & over is extremely problematic.
answered Sep 12 '11 at 05:12 AM
Grant Fritchey ♦♦
Can you explain what you are trying to achieve and for what purpose please?There are very few reasons to shrink a database and to apply automation to this process, which your question seems to allude to, is a rare situation to be in.
answered Sep 12 '11 at 01:56 AM
Shrinking usually is a bad idea....
answered Sep 14 '11 at 08:20 AM