Hey sneal, thanks for the reply.
I've just discovered that it was my bad. The problem was that I set the default schema to the name of my test database all well and good, BUT I got the connection string wrong so that the NHibernate connection was pointing to the wrong database.
The reason why it worked on an empty database I suppose is a little subtle: the create table statement, by using the fully qualified name to create the table (eg NHibernateDemo.dbo.parkinglot), it doesn't matter what database NHibernate is connecting to. On the other hand the drop statement, by querying sysobjects to determine if the table exists, *is* sensitive to the database at the end of the connection. So, because NHibernate was pointing to the wrong database the wrong sysobjects table was being queried and therefore the table in my test database was not being detected and therefore not dropped.
Thanks
|