Stateful views in SQL Server Actually I got stuck while searching a materialized view approach in SQL Server.  My problem was that I have two databases and I have created some views whose functionality is to read data from one DB to another.

For instance, a view in DB "A" is picking up the data from DB "B".  It worked perfectly, but suddenly today I got Null pointer exception.  When I traced the problem, I found that My DB "B" has crashed.  I searched and found that in Oracle, there is support of this problem by Materialized views whose functionality is to restore the old view state in case of crashing of one DB.  But I didn't find anything like this in SQL Server.

I am really stuck in this issue.  Any help would be greatly appreciated.
You could set up transactional replication from your main server to the server on which the views are materialized, and then, use a non materialized or materialized view based on their independent merits

More info:

You have server A and Server B, with A hosting DB A and B Hosting DB B

Now, you can configure transactional replication between A and B in such a way that Server A will have 2 Databases: A and B_Repl , similarly B will have B and A_Repl

The REPL databases are essentially an updated copy of the source databases. You can find many guides on how to configure replication on SQL Server

Once you have done that, you can create views on server A, and when you need to refer to database B, you refer to B_Repl instead. Similarly for server B