home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 18,520 of 19,505   
   Erland Sommarskog to Tony   
   Re: about timestamp   
   23 Nov 11 23:53:34   
   
   From: esquel@sommarskog.se   
      
   Tony (johansson.andersson@telia.com) writes:   
   > I read a book called "Beginning ASP.NET 3.5 in C# from Novice to   
   > Professional" Here is the text and according to this it seems to be easy   
   > to create and use a timestamp but when I create one for a new table and   
   > add some record to this new table the timestamp is always empty.   
      
   What you mean? A timestamp column is never empty. Here is a quick example:   
      
   CREATE TABLE ts (b int NULL, ts timestamp NULL)   
   go   
   INSERT ts (b) VALUES (NULL)   
   go   
   SELECT * FROM ts   
   go   
   UPDATE ts SET b = 98   
   go   
   SELECT * FROM ts   
   go   
   DROP TABLE ts   
      
   timestamp columns are indeed very smooth to implement optimisitc   
   concurrency.   
      
   The only problem with the type is the name. Not only is it confusing, but in   
   ANSI SQL "timestamp" is the name for the type we know as "datetime".   
      
   Microsoft has officially deprecated the name "timestamp" and recommend   
   using "rowversion" instead. Only problem is that they abide to their   
   own recommendations...   
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Links for SQL Server Books Online:   
   SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx   
   SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca