Are there databases in the database that support computed columns?

We have a SQL 2005/2008 database with a table with a calculated column. We use the computed column as a discriminator in NHibernate, so using it in the database is very useful.

In order to benefit from faster integration tests, I would like to be able to run our integration tests against an in-memory database such as SQLite or SQL CE. But I don't think any of them support computed column.

Are there any other solutions to my problem? I have full access to the database and can change it if there is a better solution. I've seen this post that suggests using a view instead of a computed column, is this a better alternative?

+2


source to share


1 answer


What I did was add the computed column to the DataTable when loading the table from SqlCe. I have saved the definition of the computed DataColumn in a config table stored in the database. I could perform complex calculations based on a "chain" of tables, where each table performed a simpler function for a more complex function. (The last table in the chain contained the results.) I used SqlCe because one table in five had 15 million rows. Too much data for datasets in ADO.NET memory. (Before submitting to the server, I had a requirement to use client-based local computing.)



+1


source







All Articles