Can I execute SQL statement without returning the results?

  • Can I execute SQL statement without returning the results?

    This sounds like a strange thing to do but there is a reason. I have been given the task of creating some benchmarking scripts that are to measure the time taken for a Server to perform different queries on different volumes of data. I am not interested in the data returned from the queries just how long they are taking.

    I would be grateful for any ideas.

    Thanks

    Daniel

  • Removing the data being retuned to an application will more than likely reduce the amount of time and work to be done.

  • If you don't have any app that can recieve the data (assume this is select statements?) you could redirect it  and insert into a temptable instead. Though, as Kory says - you should also measure the time it take to 'handle' the results (if it's any measurable volumes, that is)

    /Kenneth

  • Thanks for the replies.

    Personally I think benchmarking a server in this way is a waste of my time but my manager is very keen on the idea. lol.

    There is no application and the data is randomly generated as part of the script. The idea is to generate some sort of routine to benchmark SQL Server's performance when it has deal with various amounts of data.

    Therefore a query might be to aggregate a numeric column grouped on another column with 10 variations. Firstly this is done with 1 million records then 2 million record etc. As you can see the results aren't interesting to me, just the time taken for SQL to do the grouping/aggregations.

    I had thought about using temp tables but I thought the overhead would be a little unfair on SQL.

    Daniel

  • Capture the start and end times in a log or log table and discard the resulting output.

  • Try running from your client app and use some form of execute with no records option (I know that ADO can do this - I assume ADO.NET can also do it).

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply