Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to over-write a table in C# Sql select
Message
From
08/08/2010 18:02:55
 
General information
Forum:
ASP.NET
Category:
Databases
Miscellaneous
Thread ID:
01475647
Message ID:
01475687
Views:
33
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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform