SQL Server Performance


Discussion in 'General Developer Questions' started by Reddy, Oct 26, 2005.

  1. Reddy New Member

    Hi Guys.. I just wonder how views work in sql server,I never used it.

    I have pulled up a result set as per my requirement through a view by doing some inner joins. Though I do not have any relationship between 2 tables but my view pulls up records from those 2 tables by having an inner join. Is it possible tht I can do inner joins though i do not have relationship in my schema.

    As I am new to SQL, can any one tell me clearly where and how we can make use of views or can give any link where i can read abt them.

    "He laughs best who laughs last"

  2. Madhivanan Moderator

    Goto article sections and read more about VIEW

    Give table structure, sample data and the code you used


    Failing to plan is Planning to fail
  3. Reddy New Member

    Ok 1 question..
    If am deleting a relationship from my view design mode, does it also deletes in my DB scehma?

    "He laughs best who laughs last"

  4. Adriaan New Member

    In a view you don't have relationships, only JOINs like in any regular SELECT query.

    If a JOIN in a view corresponds to a relationship, then you will see the one-to-many or one-to-one signs showing next to the JOIN in the graphical representation, just for information.(*) It's still only a JOIN, not a relationship.

    You can drop the JOIN from the view, but make sure that you understand what a JOIN does.

    (*) Only if you create the view in EM using the diagram pane.
  5. Reddy New Member

    so it means that I can delete any join from the view but still my DB schema will not effect?

    "He laughs best who laughs last"

  6. ranjitjain New Member

    Views are virtual table which takes data by joining two or more tables and then if you delete the join it will not affect any table.
    You can also read about views in Books Online.
  7. satya Moderator

Share This Page