Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    London, England
    Posts
    106

    Unanswered: Creating sql by using "view-creator" in EM

    I have never really used alot of views before but when I created a view from a sql-query I've previously made I discovered that it rearranged my entire query, adding owner and tablename in front of all fields and everything. I tend to make stored procedures of my sql-queries, but should I maybe have the "view-creator" fix my query before I put it into the sp? Will this ease the load on the query-optimizer or something?
    Frettmaestro
    "Real programmers don't document, if it was hard to write it should be hard to understand!"

  2. #2
    Join Date
    Mar 2003
    Location
    Bucharest, Romania
    Posts
    80

    Re: Creating sql by using "view-creator" in EM

    It's a recommanded practice to reffer to your tables in the form owner.tablename because in this way your users can benefit of cached execution palns for that query. SQL Server first looks for a cached query of the owner (if specified one), or else try to find another cached exec plan for the user of the connection.

    IONUT

Posting Permissions

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