Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to over-write a table in C# Sql select
Message
 
 
À
08/08/2010 18:02:55
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01475647
Message ID:
01475688
Vues:
28
>Naomi,
>
>
>>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
>
>The above doesn't work, you'll get an error. You need to specifically name the columns:
>
>
>Insert into TableA (Country, State) select Country, State from TableB 
>
>
>~~Bonnie

You don't have to if TableB only has Country and State columns in that order as Gerard specified. Although it's a good idea to be explicit.
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