In Access 2000 this query works

Select STDEV(x) from (Select W1 as x from TAB Union All Select W2 from TAB)

In MS SQL 2005, I get an error: Incorrect syntax near ')'

ADO, ODBC connection, SQL Server driver.