James Corden
Member
I have installed Dadabik onto an existing SQL Server database. The Primary Keys on all the tables of this database are non-sequential. So for example, entries that have been added sequentially by date into one table have the following values in the Primary Key column.
201356
201358
201402
201422
201437
201451
I don't understand how these values are being generated or why they are non-sequential. I imagine this is a property of the existing SQL Server database or the program used to insert data into this database. The values are always increasing but apart from that there doesn't appear to be any pattern (i.e - increasing by the same amount each time). I think it might be a security issue.
I have set the same column to be the Primary Key column in the Data>Table and Views section of Dadabik.
However when I try to add new entries to a table using a simple form I get the error message that I have to enter a value for the Primary Key.
How do you use Dadabik on an existing database where there is already data in tables and the existing primary key is not sequential (i.e 1,2,3,4,5 etc.)? I can't set a new primary key column for each table because the primary key in a lot of the existing tables is used as a foreign key in other tables so this would mess up all my relationships.
In the new database, it would be acceptable to auto-increment the primary key from the most recent value in the primary key column based on the old data. So for example if the last entry in the primary key column (before entering data via Dadabik) was 1679 then it would be acceptable for the new primary key values to auto increment from this point (1680, 1681, 1682 etc.).
I have tried setting Extra to identity on the Data>Tables and Views section (as the help comment for Extra suggests that this is what you need to do if you want the Primary Key to auto-increment) but this resulted in the following error message which suggests Dadabik is trying to set up a new primary key on the table in question.
unexpected error drop_table_form.submit ajax error{"readyState":4,"responseText":"<p><b>[08] Error:</b> during query execution. alter table "TECHNOL" ADD PRIMARY KEY ("PRIMARYKEY"
<br/>The DBMS server said: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Table 'TECHNOL' already has a primary key defined on it.","status":200,"statusText":"OK"}
Dadabik is advertised as being suitable for use with existing databases so interfacing with the existing primary keys must be a common problem but I can't find any reference to this on the forum.
Thanks
201356
201358
201402
201422
201437
201451
I don't understand how these values are being generated or why they are non-sequential. I imagine this is a property of the existing SQL Server database or the program used to insert data into this database. The values are always increasing but apart from that there doesn't appear to be any pattern (i.e - increasing by the same amount each time). I think it might be a security issue.
I have set the same column to be the Primary Key column in the Data>Table and Views section of Dadabik.
However when I try to add new entries to a table using a simple form I get the error message that I have to enter a value for the Primary Key.
How do you use Dadabik on an existing database where there is already data in tables and the existing primary key is not sequential (i.e 1,2,3,4,5 etc.)? I can't set a new primary key column for each table because the primary key in a lot of the existing tables is used as a foreign key in other tables so this would mess up all my relationships.
In the new database, it would be acceptable to auto-increment the primary key from the most recent value in the primary key column based on the old data. So for example if the last entry in the primary key column (before entering data via Dadabik) was 1679 then it would be acceptable for the new primary key values to auto increment from this point (1680, 1681, 1682 etc.).
I have tried setting Extra to identity on the Data>Tables and Views section (as the help comment for Extra suggests that this is what you need to do if you want the Primary Key to auto-increment) but this resulted in the following error message which suggests Dadabik is trying to set up a new primary key on the table in question.
unexpected error drop_table_form.submit ajax error{"readyState":4,"responseText":"<p><b>[08] Error:</b> during query execution. alter table "TECHNOL" ADD PRIMARY KEY ("PRIMARYKEY"
Dadabik is advertised as being suitable for use with existing databases so interfacing with the existing primary keys must be a common problem but I can't find any reference to this on the forum.
Thanks