Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to over-write a table in C# Sql select
Message
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01475647
Message ID:
01475680
Vues:
31
>Thanks Naomi. That works fine.
>
>One other similar question
>Is there any construct in SQL to emaulate the Append, but keeping existing fields intact
>e.g.
>TableA has Country,State,City,Town and is empty (no records)
>TableB has Country State and has some ecords in it
>
>Sele TableA
>Append From tableB
>..... This keeps the structure in TableA but adds on all the records from tableB and pads out fields with spaces or Zeros that exist in TableA but not in TableB
>There would not be a key linking both tables.
>
>
>Regards,
>Gerard
>
Insert into TableA (Country, State) select * from TableB 
where not exists
 (select 1 from TableA where TableA.State = TableB.State and TableA.City = TableB.City) -- if you only want to append new (not existing) records
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform