CodeSmith Community
Your Code. Your Way. Faster!

Problem with timestamp columns that looks like CONCURRENCY_TIMESTAMP

Latest post 02-07-2008 5:38 AM by Jarmo Blomster. 0 replies.
  • 02-07-2008 5:38 AM

    Problem with timestamp columns that looks like CONCURRENCY_TIMESTAMP

    The problem is that

    generated code should look like:

    .... 

    SELECT

    @ReturnedConcurrencyTimestamp = [CONCURRENCY_TIMESTAMP]

    FROM

    [dbo].[T_SOME_TABLE]

    WHERE

    [SOME_TABLE_ID] = @SomeTableId

    .... 

    But it looks like

    ....

    SELECT

    @ReturnedConcurrencyTimestamp = [ConcurrencyTimestamp]

    FROM

    [dbo].[T_SOME_TABLE]

    WHERE

    [SOME_TABLE_ID] = @SomeTableId

    Which is not correct because there is no T_SOME_TABLE.ConcurrencyTimestamp field in table.

    The correct field name is T_SOME_TABLE.CONCURRENCY_TIMESTAMP

    Here is my patch for fixing the problem, can you please run it to svn.

    Index: StoredProceduresXml.cst
    ===================================================================
    --- StoredProceduresXml.cst (revision 701)
    +++ StoredProceduresXml.cst (working copy)
    @@ -487,7 +487,7 @@
          if (RowVersion != null)
          {
           tempParams += string.Format(", @Returned{0} = [{1}]{2}",
    -      GetPropertyName(RowVersion), GetPropertyName(RowVersion), Environment.NewLine) ;
    +      GetPropertyName(RowVersion), RowVersion.Name, Environment.NewLine) ;
          }
          
          Response.Write(tempParams.TrimStart(','));
     

     

    Filed under:
    • Post Points: 5
Page 1 of 1 (1 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems