Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    6

    Smile Unanswered: 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,
    Sushma

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    Most 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.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •