Simple-ish SQL Server question

Results 1 to 2 of 2

Thread: Simple-ish SQL Server question

  1. #1
    Franco Guest

    Default Simple-ish SQL Server question

    I want to run a stored procedure that checks whether a record&#039s id appears in other tables before deleting that id. I can get my head around RAISERROR but how do I get ASP to recognise the return value?<BR><BR>Thanks<BR><BR>F.

  2. #2
    Join Date
    Dec 1969

    Default RE: Simple-ish SQL Server question

    you need to use a command object and set up a parameter to receive the value of RETURN from the SP. once the command is executed you can the evaluate the value of the parameter.<BR><BR>Set oCmd = Server.CreateObject("ADODB.Command")<BR>oCmd.Comma ndText = "&#060;SP Name&#062;"<BR>oCmd.ActiveConnection = &#060;ConnectionObject&#062; <BR>oCmd.CommandType = adCmdStoredProc<BR>oCmd.Parameters.Append oCmd.CreateParameter("&#060;AnyInputParam"&#062;,& #060;ParamDataType&#062;, _<BR> adParamInput,&#060;Size&#062;,&#060;Value&#062;)<B R>oCmd.Parameters.Append oCmd.CreateParameter("RETURN",adInteger,adParamRet urnValue)<BR>oCmd.Execute<BR><BR>varRetValue = oCmd.Parmeters("RETURN")<BR>

Posting Permissions

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