Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add records from one table to another
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Add records from one table to another
Divers
Thread ID:
01652499
Message ID:
01652499
Vues:
73
Hi,

I would like to create a SQL Insert (for SQL Server DB) that would add records from one table to another and automatically set fields of certain values. Here is a simplified example:

The table which now has records. Name TENANT
Fields: TEN_PK, USER_ID, USER_PWRD

The table where the records should be added: Name TEN_NAME
Fields: TEN_PK, USER_ID, USER_PWRD (basically the same field names)

Example:
TENANT:
TEN_PK, USER_ID, USER_PWRD
1 "ABC" "123"
2 "CBS" "444"
3 "NBC" "9933"

After this SQL Insert the table TEN_NAMES will have the fields with the same values.

I am starting to write a SQL Insert but get lost quickly. I would appreciate any help.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform