The solution I arrived at was to split the binary(8) timestamp into two
integers using the substring and convert functions and then use a
comparison of the timestamp value against these two integers - I did not
use tsequal.
James Sharier Jr. <james....@amd.com> wrote in article
<01bc2afc$e497f3a0$57d7b5a3@broomstick>...
> Hi
>
> I'm using VFP 5.0 and SQL Server 6.0.
> I'm having a problem using TimeStamps to perform optimistic locking.
> In SQL the TimeStamp is stored as a binary and is converted to a memo
> on the VFP side. I'm using a SQL stored procedure to perform updates.
> I send the procedure the values to update along with the timestamp.
> The stored procedure uses a tsequal against the timestamp sent in.
> When performing the SQLEXEC(handle, 'proc p1, p2, ..., pn, ts')
> VFP acts like the timestamp was not included and gives me an error.
> Any help is appreciated.
> TIA
> --
> _
> -------------------ooO-( )-Ooo---------------------------------
> James Sharier Jr. <>< (0 0) (512)602-5193 james....@amd.com
> ~~~
>
>
>
Hi Richard,
FYI, I was able to get things to work out with the help of Paul West from
Microsoft. VFP passes the TimeStamp to the Stored Procedure as
VarChar(8). So To get it to work I had to do the following
in the stored procedure :
CREATE PROCEDURE MyProc @ID Int, @MyField Char(x), @ts VarChar(8) AS
UPDATE MyTable
SET MyField = @MyField
WHERE ID = @MyID
AND TSEqual(ts, CONVERT(VarBinary(8), @ts))
Good Luck
James Sharier Jr. <james....@amd.com> wrote in article
<01bc35fb$342c4070$57d7b5a3@broomstick>...