Re: Passing Timestamp value to sql server

From: Sylvain Lafontaine ("Sylvain)
Date: 09/08/04


Date: Tue, 7 Sep 2004 22:11:35 -0400

First, the following example cast the timestamp to a data type of datetime:

http://arcobjectsonline.esri.com/ArcObjectsOnline/Samples/Geodatabase/OLE%20DB/Miscellaneous%20Tips/Reading_NTEXT-TIMESTAMP_flds.htm

You can also cast it to another type. Surely you can find a lot of other
examples by making a search on the internet.

Second, unless you are using a table lock, you must not check if the data
has been updated before you make the update but at the same time; otherwise
you can hit a race course condition. This can easily be easily achieved by
putting all the tests in the same WHERE condition as the UPDATE query.

S. L.

<anonymous@discussions.microsoft.com> wrote in message
news:7acf01c4953f$865c9830$a601280a@phx.gbl...
>I still need to pass the value back to the server.
>
> Basically, I have a form that connects to the server, gets
> the data, then release the connection. If the user updates
> something, then I need to check to see if the data has
> been updated before I do an update. If I was connected all
> the time to the server, then the solution is simple -- I
> let the server handle it. Yet, I need the value of the
> timestamp to compare but I don't know what datatype to
> store or pass back so a stored procedure can process it.
>
> All this is of course done in ADP.
>
> If you have any other ideas please post. Thanks.
>
>>-----Original Message-----
>>Can't you use a Trigger to check for updates?
>>
>>Create Trigger PasswordTable_Trigger1
>>
>>On dbo.PasswordTable
>>
>>For /* Insert, Update, Delete */
>>
>>As
>>
>>/* If Update (column_name) ...*/
>>
>>hth,
>>
>>bob mcclellan
>>
>>
>>
>>"Beth" <anonymous@discussions.microsoft.com> wrote in
> message news:7a5d01c4951b$6ed8e3e0$a301280a@phx.gbl...
>>> Hello,
>>>
>>> To resolve concurrency issues, I am retrieving sql
>>> timestamp value and with every update passing the value
>>> back and raising an error if the timestamp has changed.
> My
>>> problem is that I don't know what data type to pass in
> the
>>> CreateParamater method. I am using ADP and created a
>>> stored procedure.
>>>
>>> A related question is what other method can I use to
> check
>>> for updates if I don't have direct table permissions. I
>>> cannot use SELECT statements. I can only access stored
>>> procedures.
>>>
>>> Thanks.



Relevant Pages

  • Re: mySqlBytes.buffer is getting converted to BigEndian even though both SQL server 2005 and the CLR
    ... The behavior the OP claims to observe is that the cast, not BitConverter, is ... convert a data type from its original data type and back again, ... It is the BitConverter class that 'knows' to return the bytes for an int ... server 2005 and the CLR function are on the same machine which shows ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQL timestamp column for concurrency
    ... In your SQL Stored Procedures cast the timestamp to an int type during ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: date time stamp in sql
    ... Some further information on the Timestamp type in SQLServer, ... The Transact-SQL timestamp data type is not the same as the timestamp data ... So I think in SQLServer, if we want to store date/time data, we should use ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CAST error during FETCH in SQLRPGLE program
    ... C+ LEFT OUTER JOIN ALLOCCAN B ... A character in the argument for the CAST function was not correct. ... Change the result data type to one that recognizes the characters in the CAST argument, or change the argument to contain a valid representation of a value for the result data type. ...
    (comp.sys.ibm.as400.misc)
  • type casting to float to "ensure reliable comparison" ?
    ... mktime() function to convert the date of birth to a large numeric Unix ... timestamp value, and the strtotime() function to discover the timestamp ... *Both are cast to a large floating number to ensure ...
    (comp.lang.php)

Quantcast