This is an example of one of the statements that is hung.
There are all the same but selecting from a different object.
SELECT @cnt = AS400TableCount FROM OPENQUERY(LScypR40DAT, 'SELECT COUNT(*) AS400TableCount FROM PMSPSA35')
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/