Link to home
Start Free TrialLog in
Avatar of Zolf
ZolfFlag for United Arab Emirates

asked on

Convert View into Tables in MSSQL 2008

Hello there,

I have taken some complex SQL query and converted them into View so I can us in my Java application. Now I want to know, if I convert these Views into Table will the report be faster and Can I in the first place create tables directly from those query instead of first creating a View and then Table.

cheers
Zolf
SOLUTION
Avatar of Vikas Garg
Vikas Garg
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The advantages of the Views is that the data are dynamic and don't requires storage. You don't need to insert/update or delete to change data, since the data are already in the tables that are part of the View.
If you transform a View into a table, then you'll need to manage the new table, running the same operations that runs in the main tables. Can't see why you want to do that.

Not all Views can be materialized. Only deterministic Views can. Also, will require storage and if you need to change the View in the future will need to drop the index and recreate the View. But can be a solution instead of creating a new table.
Avatar of Zolf

ASKER

Vitor Montalvão

Thanks for your feedbacks.

The advantages of the Views is that the data are dynamic and don't requires storage.
Do you mean if the data in those table from which I created the view will change the view will get those data updated automatically or I need to again run the create View to update those data.
CAn you please tell me how can I create index on the view I created.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

thanks, can you please refer me to some good article where I can create index for View.

Also don't forget that only deterministic Views can be indexed.
Can you please elaborate on deterministic Views

Also how can I know if the tables column has index
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Zolf

ASKER

Thanks guys