Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
niranjankumark
Posting Yak Master
164 Posts |
Posted - 2008-05-23 : 07:31:14
|
i automated qry to execute in every week . this automation done by batfile , from here i am executing in server . it takes 1.10 minutes , however if i run same qry in qry analyzer directly it takes only 10 minutes. there is no user while running in 2 scenario .. let me know what can be done to improve performance while running thru batfile. |
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2008-05-23 : 08:05:58
|
What about setting up a SQL Server Agent job scheduled for every week instead? If your script is too long for the character limit you could turn it into a stored procedure instead and run that from the Server Agent. That way you'd even get a benefit from the stored procedures cached execution plan.-------------Charlie |
 |
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2008-05-23 : 08:08:09
|
Or. if you need to use the batfile, turn the working part of your query into a stored procedure and then call it through the batch file. Again you'll probably see a performance benefit.-------------Charlie |
 |
|
niranjankumark
Posting Yak Master
164 Posts |
Posted - 2008-05-23 : 08:13:49
|
THE QRY IS AVAILABLE IN THE VIEW .. JUST I AM SELECTING THE VIEW FROM THE BATFILE.. HOW DO U SAY PROCEDURE WILL IMPROVE ? |
 |
|
Transact Charlie
Master Smack Fu Yak Hacker
3451 Posts |
Posted - 2008-05-23 : 09:31:10
|
Well, I guess if you are just selecting information solely from a view without joining it to any other tables than a stored proc wouldn't help you. The view's performance shouldn't improve.How about posting your query and bat file?-------------Charlie |
 |
|
|
|
|