dbptk-developer
dbptk-developer copied to clipboard
siard --> microsoft sql: Error executing query: ALTER TABLE ... ADD FOREIGN KEY
Description: A siard file is loaded with dbptk into a Microsoft SQL Database. No error message occurs during the transfer, but in the end only 2 out of 8 tables are transferred. Only in the dbvtk.log the user can see, that an error occured during an ALTER TABLE query as a part of the automatic transfer process.
Steps required to reproduce the bug:
- Load the siard-file in dbptk
- Send to Live DBMS (Choose SQL)
- Notice in SQL-Database that only 2 Tables were loaded.
The siard-file: 0_1-3_Northwind_simple_220913.zip
Attach the dbptk-app.log.txt file below. dbvtk.log
The database user has the correct permissions?
Meanwhile I checked the permissions of the user/login "testlogindbptk" This was the login/user which I created for the upload siard-->microsoft sql.
In order to check, if the user has the permission to alter the tables, I did the following:
- I log into the Microsoft SQL Server Management Studio as user "testlogindbptk"
- I create a table with two columns which are used as primary and foreign key.
- I create the primary and foreign key.
I captured the process in the attached video:
https://user-images.githubusercontent.com/58251561/191464214-d2f17c5c-4a7c-4341-a2f5-53084c0101f2.mp4
Hi,
Manage to find the problem:
SQL Error [8111] [S0001]: Cannot define PRIMARY KEY constraint on nullable column in table 'Customers'.
However due to the way DBPTK works it executes the prepared statements in batches making the errors not so obvious.
Thank you. I have changed accordingly key-relevant columns from _