Results 1 to 6 of 6

Thread: [RESOLVED] Multiple Selects in Stored Proc SQL 2000

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Resolved [RESOLVED] Multiple Selects in Stored Proc SQL 2000

    Not sure if this would be better handled in the vb.net section but here goes.

    Is there a way that I could call a single stored procedure that has multiple selects in it and easily assign them to their own datatable within a dataset?

    So one stored procedure would be basically the datasource for multipe datatables?

    Or should I just stop being lazy and break them up?

    Thanks

    Blah wrong forum... please move to database section

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Multiple Selects in Stored Proc SQL 2000

    Quote Originally Posted by Besoup
    Blah wrong forum... please move to database section
    Done.

  3. #3
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Multiple Selects in Stored Proc SQL 2000

    Quote Originally Posted by Besoup
    Is there a way that I could call a single stored procedure that has multiple selects in it and easily assign them to their own datatable within a dataset?

    So one stored procedure would be basically the datasource for multipe datatables?
    yes you can do that,the only thing is your datatables name in dataset will be Table1 table2 etc. which u can easily change using
    dsMyDataset.Tables(0).TableName="MyTable1"
    __________________
    Rate the posts that helped you

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Multiple Selects in Stored Proc SQL 2000

    so call it just like normal and expect more tables?

  5. #5
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: Multiple Selects in Stored Proc SQL 2000

    yes just call SPOC as

    Code:
      Dim dsMyDataSet As New DataSet("MySet")
            Dim daSQL As New SqlDataAdapter("USP_SELECT_TABLE", "Connection")
            daSQL.SelectCommand.CommandType = CommandType.StoredProcedure
    
            daSQL.Fill(dsMyDataSet)
    __________________
    Rate the posts that helped you

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Multiple Selects in Stored Proc SQL 2000

    Thanks alot... that's way too easy. :P

Posting Permissions

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



Click Here to Expand Forum to Full Width