Wednesday, March 28, 2012

query with view locks database (was "Problem with Viiews")

Hi,
I am joining a table with a view in my query to get the desired data. But when I run this query it does not produce any result, instead the execution goes on never ending finally locking the database.
Surprisingly if the selected data from this view is put in a temporary table and that table is joined with the table to get the result, it works fine.

Could anybody please help me with this as creating a table every time would be slow procedure. Is there any restrictions related to views which may be I have ignored.

Thanx in advance.

Regards,
SushmaMost of the time the ways views are implimented or used are not very efficient. They often result in slow queries because you are in effect querying a query and the result you are seeking is often more efficiently achieved by writing one well formed query. If the view was created for security purposes there are alternatives like restricting access to a table but granting access to a stored procedure that accesses a table.sql

No comments:

Post a Comment