ASP / SQL Server question

Results 1 to 2 of 2

Thread: ASP / SQL Server question

  1. #1
    Join Date
    Dec 1969

    Default ASP / SQL Server question

    Hi guys,<BR><BR>I&#039ve been set the following question, and am not quite sure what the answer is:<BR>------------------<BR>There is an ASP variable called myDate, which contains a date with no time component. You want to call a stored procedure called spUseDate, which takes one argument of type datetime. Why is the following call to spUseDate not good practice?<BR><BR>SQLString = "exec spUseDate &#039" & myDate & "&#039"<BR>----------------------------------<BR><BR>I wouldn&#039t code this myself, I would use the ADO command object and append the parameter to the parameters collection. However, apart from the fact that I can&#039t get a return parameter from this code above, I can&#039t nail down why the above code would be considered to be bad practice.<BR><BR>Any ideas?<BR><BR>Andy<BR>

  2. #2
    Michal M Guest

    Default RE: ASP / SQL Server question

    Hi Andy,<BR>The only thing I can think of is that if there is no time component, SQL server will assign a default time (I think 12:00am,) and then you might not get the expected result from the stored procedure.<BR>Not sure if this is the answer they are looking for,<BR>Michal M

Posting Permissions

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