Re: Re: Calling MSSQL Stored Procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Have you tried using the SQL Profiler??? This can output everything that happens on the SQL Server, and specifically only output data on SPs that execute.

So, if you put a print command inside your SP which prints the date that it "should" be receiving, you may be able to work out of it is indeed in the correct format.  If it's blank, then indeed it is in the wrong format, or, you are actually sending it a blank.

If the case is definitely you are sending it, then send it a text only date as a date variable, then get the SP to print the text based date parameter and then see what it is outputting, this could give you the clue you are looking for.

Basically, in your SP just put the following as the first thing it executes.

print @Today

Lastly, the line:
$PMdb->InParameter($SQL, $ActualDate, "Today");

Could it be that it expect the real name of the parameter as this:
$PMdb->InParameter($SQL, $ActualDate, "@Today");

Regards,

Kevin Smith

Mark Rees wrote:
The type problem in not in PHP but in SQL Server. The sp expects an input
parameter of type datetime, and it isn't getting one.

http://www.php.net/function.mssql-query has the answer to this question,
which is to supply the parameter as varchar and use CONVERT in the sp to
change it into a datetime



      
As other programs, not under my control, are already using that Stored
Procedure altering it is really not a good idea.

    

I think you've had it then, unfortunately, unless anyone else has solved
this problem. You could write a wrapper sp which does the conversion,
perhaps.

This looks like a really annoying problem and I can only sympathise.

You could try posing the question on php-general, many more people read it
than do this list.

good luck, and please report back if you find a solution

Mark

  

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux