Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending timestamp to sql server.

Status
Not open for further replies.

rombout

Programmer
Jan 24, 2000
24
NL
Hi there

Im trying send a timestamp value fetched from a sql server table back to a stored procedure to check server side if the record has been changes by an other user.
But when I fetch the timestamp it comes in a memo field and when I send it back to the stored procedure it seems to be empty.
I have tried several datatypes in the stored procedure but it does not work.
Can somebody help me.
Thanx
 
Hi,

I have the same problem. A workaround may be fetch a CASTed timestamp using bigint. VFP can handle this, so you can sendit back to SP.

salu2!

ps1: bigint its only available in SQL Server 2K.
ps2: my english is really poor :(
 
I have found out how to do it. The timestamp parameter you send to the stored procedure from vfp is data type memo and yoe recieve it in the stored procedure as a varchar(8). In the stored procedure you sould declare a variable with the datatype timestamp and then convert the parameter to datatype timestamp.
like this:

declare @vartimestamp as timestamp
set @vartimestamp = cast( @paramtimestamp as timestamp )

Then you can do a update with in the where clause tabletimestamp = @vartimestamp.
And then return @@ROWCOUNT to check if there was an update.

Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top