I just tried the first osql cmd you wrote in SQL 2005 and replaced osql with sqlcmd
osql command runs in 7 seconds
sqlcmd runs in 2 minutes 26
SQL 2005 docs say that sqlcmd is the replacement for osql. Can this be right? Obviously they are structured very differently, but wouldn't you expect that sontinuity of performance might be desirable?