trabart
trabart

Reputation: 387

How to suppress results when running a query

I have a large query running that loops over multiple stored procedures. Based on business rules, I'm calling the appropriate stored procedures for each record that is in my loop. The problem is that those stored procedures sometimes generate multiple result sets. What happens then is that in SQL Server Management Studio, the 'results pane' gets filled up with data, it slows down SQL Server Management Stidion and in the end Management Studio even crashes with an out of memory exception. Is there any way in which I can suppress the results from showing up?

Upvotes: 1

Views: 707

Answers (2)

JNK
JNK

Reputation: 65147

You can also execute it from a command line using OSQL, and specify a logfile:

osql -E -S ServerName -d DBNAme -q "EXIT(<QUERY STUFF HERE>)" -o PathtoLogFile.txt

Upvotes: 1

warsong
warsong

Reputation: 1038

run the query as a job in Sql Server Agent.

Upvotes: 1

Related Questions