2
Opa Bom dia.
I have a sql database, in this database there is a table for People, it is a second table for registration of credentials, in a third table and made the association of the credential with the person, ie there is a table called CRED_PESSOAS, where through the person code is the credential number is made the credential association for person.
I have a client who asked to feed this credential information through scripts, already fed the two tables (PEOPLE AND CREDENTIALS) my doubt is how to create a condition, where I take for example the credential X for person Y, credential y for person x and so on.
Thank you in advance. Gustavo Braga
Gustavo, welcome to stackoverflow in Portuguese, it would be nice to make a Tour, and edit your question with some information like; Which database? and which table structure?
– Marco Souza
OPA, Thanks for the tip I will pay more attention yes, but I do not know much of SQL is much less of this base just received this demand here in the office, commercial thing that sells what can not deliver kkk
– Gustavo Braga
Well, you’re entering this data, I believe you know which database this information is being stored in, and which table fields.
– Marco Souza
So I still don’t understand what you need to know exactly, the Database is SQL SERVER, the tables I’m feeding are the ones I mentioned, in the credential table I fed a column called CRED_NUMERO, as the credential number, In the Table PEOPLE I did in a type of Insert because people were already registered, from it I just need to take the PES_NUMERO to associate with the credential in the table CRED_PESSOAS
– Gustavo Braga
Ok, when a data is already inserted ( ... In the PEOPLE Table I did in a type of Insert because people were already registered, ...) what you do is an update to update the field, you need to take the PES_NUMERO, but how you will use this and what information you have to regasta this number?
– Marco Souza
I edited the post with two images, which should look better what I need.
– Gustavo Braga
Where is coming the data from a spreadsheet, database or application. Show how you did the other Insert and what you need to do, I still don’t know what you want.
– Marco Souza