1
Vote

Tweakings to make your code work

description

I haven been tweaking your application (don't use the release, use the source code version), it needs some small fixes in order to make it work properly:
 
  1. The SELECT statement used to get the column structure, needs the following change (substring of the select pasted)
    ISNULL((SELECT /<fix>/ TOP 1 /</fix>/'Y' FROM SYSFOREIGNKEYS WHERE FKEYID =ID AND FKEY=COLID),'N')
     
    2 The code that generates strings, has a bug you forgot to add a single quote end char:
    //FIX: bd added + "'" at the end ColumnValue = "'" +*/ RDGenDCM.GetForeignKeyValue(TableColumn,this.Name)+ "'";
     
  2. The GetRandomValue for the "bit" type, has another bug, need to comment a piece of line:
     
    // FIX bd: bug here, why it insert double Column Values ?
    ColumnValue = /*_InsertStatement.ColumnValues +*/ DataBuilder.GetBit();
     
    Generate a Sequence of INSERT is not a bad idea, but once you have more than 10.000 INSERTS in the same script you won't be able to run such script, you can easily transform the generation to a CSV file, but then you have to face the problem of duplicate entries, you cannot use BULK INSERT :-(. Anyway, interesting tool, if you want me to fix that bugs in code, just give me access to the repository.

comments