Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to over-write a table in C# Sql select
Message
 
 
To
08/08/2010 18:02:55
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01475647
Message ID:
01475688
Views:
27
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform