It's been awhile since I played around with Oracle, and for me, the introduction of schemas in SQL Server 2005 really went unnoticed. Well, today it came up and bit me in the backside pretty savagely. It's quite obvious, (like everything) but the following code created a few issues for me...
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = "Address")
DROP TABLE Address
The issue? If any table in any schema has the name Address, then it will drop my table. The fix is pretty easy...
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = "Address" AND TABLE_SCHEMA="DBO")
DROP TABLE dbo.Address
As I said - obvious.