SubSonic Forums
All Your Database Are Belong To Us

SubStage Script Data Error In SS2.1 Final

Latest post 08-21-2008 10:10 AM by kevinw. 2 replies.
  • 08-20-2008 7:24 AM

    SubStage Script Data Error In SS2.1 Final

     I have just tried to use the Script Data option in SubStage to generate a script for one of the tables in my SQL Server 2005 database.

    Apart from there not being an obvious option to just do one table, and the output file being hidden amongst all of the generated DAL classes (it would have been nice to just allow it to script the data without regenerating the classes), I have a problem with my output.

    The table has a Timestamp column called timestamp_column as recommended in the naming conventions.  However, each INSERT statement generated (there are over 2,000 in this one table which I cut out from the full file) [timestamp_column] in the file list, but no value in the values list.  This creates an error :

    Msg 109, Level 15, State 1, Line 1

    There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.

    I think this routine should exclude any timestamp columns from the list of fields as well as the values.

    Kevin

    (PS how do you get this forum to reset the font?)

     

     

    Filed under: , ,
  • 08-20-2008 1:24 PM In reply to

    Re: SubStage Script Data Error In SS2.1 Final

    In SubStage you can check the Script/Code to generate

    timestamp_column - I never heard of this convention.

    The script are generated usingMicrosoft.SqlServer.Management.Smo and it generates all tables

    kevinw:
    (PS how do you get this forum to reset the font?)
    You kind of have to edit the HTML.

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

  • 08-21-2008 10:10 AM In reply to

    Re: SubStage Script Data Error In SS2.1 Final

     Thanks for your reply, yitzchok.

    I had found the checkboxes in SubStage to generate the data and used them.  My comment was that I didn't seem to be able to stop it also regenerating all of the classes at the same time - ie I couldn't just generate the data.

    I'm afraid that I can no longer find a reference to timestamp_column being a convention (I'm sure I saw it somewhere in the past).

    However, the main point of my post still stands - if you generate the data with SubStage, any table containing a timestamp data type column generates invalid SQL, and therefore fails if you try to run it.  Specifically, it includes the column name in the columns part of the INSERT statement, but does not include a value in the values part, so the SQL has more columns than values and fails when run.

    I actually believe it is correct in not including a value, but it should also exclude the column name as well.

    Kevin

Page 1 of 1 (3 items) | RSS