Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sharu_tan
Starting Member
11 Posts |
Posted - 2003-02-28 : 04:37:25
|
| Dear sir In my project i am converting data from Access 2000 to Sql Server 7 .So first i have to check the data is exist or not in Sql server. if exist then i have to write Update statement otherwise i have to write "Insert into" statement through VB. so please tell me more this regarding |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2003-02-28 : 07:39:38
|
| In Access 2000, link to all the tables in SQL server you need to add to or update. make sure that same database also contains the Access data you are converting, or table links to the data.Then, in Access (no need for VBA), just do a simple two step process for each table: First, create and run an UPDATE QUERY and join the Access table with the SQL table to update records that are already there.Then, create and run an APPEND QUERY to add in the records that AREN'T in the SQl table already. You can use a LEFT OUTER JOIN to determine if the data is there already. (This is done in Access by checking the "Show all records from table1 and only those in table2 that match" option in the join properties in your query.)The JET engine, for all of its faults, is very good at this sort of thing. Confused? In Access help, look up APPEND queries, UPDATE queries, LINKED TABLES, JOIN PROPERTIES and try using the "unmatched query wizard" in the "New Query" dialog box to see what kind of query going through that wizard produces.- JeffEdited by - jsmith8858 on 02/28/2003 07:41:22 |
 |
|
|
|
|
|