Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Location
    Midlands
    Posts
    135

    Unanswered: Can you assign the select result of a stored procedure as a value?

    Hi all, hope you can help.

    I was wondering if it is possible to assign the search result of a stored procedure as a value?

    what i mean is, is it possible to do something like this?:

    dim sSQL

    sSQL = "exec spGetUserName"
    SET oRS = oDB.Execute(sSQL)
    If Not oRS.EOF then
    reponse.write("nothing")

    with a stored procedure of:
    ALTER PROCEDURE [dbo].[spGetUserName]

    AS
    BEGIN
    SET NOCOUNT ON;
    SELECT
    username
    FROM
    tblusers

    END

    The above exmaple is probably wrong, but hope i have explained myself properly.

    Regards
    MG

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Mais oui!

    I think we've covered this before... http://www.dbforums.com/asp/1647320-...ml#post6420144

    Ideally you want to use nothing but sprocs to access your data, so you are definately on the right tracks!
    George
    Home | Blog

  3. #3
    Join Date
    Jun 2009
    Location
    Midlands
    Posts
    135
    Hi gvee, thank you for the reply.

    I couldn't remember if i had, I've been away on holiday and have had to pick it up again after a number of weeks, sorry for asking the same question twice.

    I have to be honest, I still cant work out how to do it even when people say im on the right lines, I struggle to see them.

    I'll read everything over again.

    Regards
    MG

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    No problemo!
    Give it a go and if you can't get it to work, post back your code highlighting any error lines/messages that you recieve and we can most likely help
    George
    Home | Blog

  5. #5
    Join Date
    Jun 2009
    Location
    Midlands
    Posts
    135
    Hi, you're too kind, I will have and go hopefully i can make some head way, or at least add my thoughts / code to help resolve the issue.

    Regards
    MG

Posting Permissions

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