Pulling PRINT results from a stored procedure

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Pulling PRINT results from a stored procedure

    Hi,

    I'd like to pull the results of a sproc within ASP as a text field, e.g.
    PRINT statements, "### Rows Affected", etc. How would I go about doing
    that?

    Regards,
    Scott
    Scott McNair Guest

  2. Similar Questions and Discussions

    1. Stored Procedure
      EXEC master..xp_cmdshell 'cscript c:\path\file.vbs' EXEC master..xp_cmdshell 'c:\path\file.exe' "Kannan" <gk_i@yahoo.com> wrote in message...
    2. drop down menu not pulling results
      I have populated a dependent two select drop down menu without any trouble Im not at all sure on the Sql for the next step however. the drop down...
    3. Pulling the Verity Collection Name from Results
      I am running CFMX 6.1 on Windows 2000 Server. I am trying to use Verity to full-text search several collections, one of which is a MS SQL 2000...
    4. Using a stored procedure
      I am trying to pass a ProdID to a stored procedure, but I get an error: Error Executing Database Query. Procedure &apos;PriceBreak&apos; expects...
    5. Stored procedure from stored procedure
      Is it possible to create a stored procedure from a stored procedure? When I attempt this inanity, it doesn't blow up until syntax error at the...
  3. #2

    Default Re: Pulling PRINT results from a stored procedure

    Change the stored procedure to return resultsets instead of print
    statements, set @@ROWCOUNT to putput variables or resultsets, etc. ADO can
    see row(s) affected messages but can't do anything with them, and I don't
    believe it can even see the PRINT statements.

    --
    [url]http://www.aspfaq.com/[/url]
    (Reverse address to reply.)






    "Scott McNair" <scott.mcnair@sfmco.takethispartout.com> wrote in message
    news:Xns952C59546A714sfmco@207.46.248.16...
    > Hi,
    >
    > I'd like to pull the results of a sproc within ASP as a text field, e.g.
    > PRINT statements, "### Rows Affected", etc. How would I go about doing
    > that?
    >
    > Regards,
    > Scott

    Aaron [SQL Server MVP] Guest

  4. #3

    Default Re: Pulling PRINT results from a stored procedure

    "Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in
    news:OgeABHmbEHA.1656@TK2MSFTNGP09.phx.gbl:
    > Change the stored procedure to return resultsets instead of print
    > statements, set @@ROWCOUNT to putput variables or resultsets, etc.
    > ADO can see row(s) affected messages but can't do anything with them,
    > and I don't believe it can even see the PRINT statements.
    Thanks for the response, Aaron. I actually was being obscure in my
    request, my primary concern was being able to pass data to an ASP page
    without having to rely on a table, through the command object. As
    ironically always seems to be the case, I found the answer within 5
    minutes of posting on the newsgroup, by doing some creative googling.

    As an aside, it's sort of frustrating to see what kind of hoops you have
    to jump through in order to pull a simple result off of a sproc. This
    seems a rather roundabout way just to get a simple boolean "yes/no"
    result, don't you think?

    Function IsAdmin(UserName)
    Dim cmd, param
    dim conServer
    Set conServer = server.CreateObject("ADODB.Connection")
    Set cmd=server.CreateObject("ADODB.Command")
    conServer.ConnectionTimeout = 120
    conServer.CommandTimeout = 120
    conServer.Provider = "SQLOLEDB"
    conServer.ConnectionString = SQLSERVER
    conServer.Open
    With cmd
    .CommandType=adcmdstoredproc
    .CommandText = "ProductDevelopment.dbo.pr_IsAdmin"
    set .ActiveConnection=conServer
    .Parameters.Append .CreateParameter ("@loginname",
    advarchar, adParamInput, 50, UserName)
    .Parameters.Append .CreateParameter ("@IsAdmin", adBoolean,
    adParamOutput)
    .execute ,,adexecutenorecords
    IsAdmin = .Parameters("@IsAdmin")
    end with
    End Function
    Scott McNair Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139