If you have just one query I don't know how to set timeout on T-SQL level.
However if you have a few queries (i.e. collecting data into temporary tables) inside stored procedure you can just control time of execution with GETDATE()
, DATEDIFF()
and a few INT
variables storing time of execution of each part.