procedure problem using

Results 1 to 3 of 3

Thread: procedure problem using

  1. #1
    Join Date
    Dec 1969

    Default procedure problem using

    I&#039;m pulling a random set of records from my DB using the #2 example at<BR>When I pass the string to my stored procedure, it doesn&#039;t pull any records yet I know they are there. Here&#039;s the SP I&#039;m using:<BR><BR>CREATE PROCEDURE [sp_testquestions] <BR>@final varchar<BR>AS SELECT questions.Question, questions.[Level], questions.RANDID, questions.[Choice A], questions.[Choice B], questions.[Correct Choice], questions.[Choice C], questions.[Choice D], questions.[Why Correct], questions.[Why Wrong], choices.Choices, categorys.Categorys <BR>FROM (questions LEFT JOIN choices ON questions.[Correct Choice] = choices.ID) LEFT JOIN categorys ON questions.Category = categorys.ID <BR>WHERE questions.RANDID IN (@final) ORDER BY questions.RANDID<BR><BR>HELP!

  2. #2
    jamar Guest

    Default RE: procedure problem using

    when you declare varchar if you don&#039;t explicity define the length of the variable, only the first input character is taken. so try varchar(1000) or whatever a safe length for your needs is. currently if the user inputs "listitem1,listitem2,listitem3,blah,more,junk,stuf f" only "l" is passed into the proc.

  3. #3
    jamar Guest

    Default ps --

    don not be afraid to use print statements or other debugging techniques in your sql to find problems. so, whenever i write a stored proceedure, i test it at the unit level by calling it from an sql command prompt to verify that i get the desired results before i even thing about calling it from and asp script.

Posting Permissions

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