2
I need a method to change data in an SQL Server table.
According to my client, all the table data can be changed. For having this possibility, I am without a fixed and unique reference frame for the bank to know which data will be changed.
UPDATE tabela SET campo = 1
WHERE outro_campo = 5
My client suggested the creation of a screen code, which would be invisible to the user, for the bank to use as a change reference, but being invisible, the user has no way to enter it, and to display this code when the screen is opened, cannot, because there is no data in the fields to use a SELECT.
Catharina, the ID as PK, you know it’s unique to be auto_increment. You have to have a screen on your system to enter the data, but do not need to enter the ID. But if you want to show a field on the screen to show the registration ID that will be registered, just do one
SELECT MAX(ID) FROM TABELA
and sum + 1 to show in the field. The MAX will get the last registered ID. Then to make the change of some record, just make aSELECT usando o WHERE = ? ID
and return the values of the fields on the change screen.– Diego Souza
Did any of the answers solve your problem? Do you think you can accept one of them? If you haven’t already, see [tour] how to do this. You would help the community by identifying the best solution for you. You can only accept one of them, but you can vote for anything on the entire site.
– Maniero