SQL Joins or Multiple SELECTS in Procedures

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stoogots2
    New Member
    • Sep 2007
    • 77

    SQL Joins or Multiple SELECTS in Procedures

    I have to either Join 4 tables, or retrieve one column from 3 tables, and one record from another.

    I can use a stored procedure to do the JOINs (doing that now), but it seems like overkill if I need one or two columns from each of the other tables.

    Alternatively, I could use OUTPUT parameters and do separate SELECT statements for each Table.

    Just looking for advice on making this process more performant.

    Regards
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    If you need to have some dynamic filtering, meaning a WHERE ColumnName = @VariableName, a table-function might the one you need. If it's a pretty much fixed SELECT, use views.

    --- CK

    Comment

    • stoogots2
      New Member
      • Sep 2007
      • 77

      #3
      CK,

      Thanks for the help. One more question for you, if you have a moment. Would it be more performant to call a stored procedure 12 - 24 times or send 12-24 lines of INSERTs at the Command Text from my ASP.NET application?

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Depending on what you're stored proc would be doing.

        What are you trying to do?

        -- CK

        Comment

        Working...