The following is legal syntax in SQL Server 2005: select * from my_table t where t.foo = 1
The following is not legal syntax in SQL Server 2005: delete from my_table t where t.foo = 1
In this example, the table alias doesn't add anything, but it does in the following: delete from my_table t1 where foo = 1 and not exists (select null from my_table t2 where t2.foo = 2 and t1.id = t2.id)
Table aliases are necessary to do same-table subselects and joins, and SQL Server will happily let you use them to find out what data you plan to delete, but not to actually delete that same data. I instead switched to delete from my_table t1 where foo = 1 and id not in (select id from my_table t2 where t2.foo = 2) which takes a really long time because it does the subselect for every row matching foo = 1.