-
Update, Delete, Insert
I am trying to update a SQL database with data from a Wang system. The Wang data is dumped to a txt file. I then import it into an update table in SQL via Access. Some of the data is new and some of the data is updated records. At this point I have been trying to create a script to update and add data to a table via the query tool in SQL Then delete data from the update table.
I was able to get the UPDATE and DELETE to work but I have not figured out how to insert new records at the same time? Can I use an IF statement? I will apreciate any help or sample code, Thanks.
UPDATE MemberList
Set Name = NameUpd, Address1 = Address1Upd, Address2 = Address2Upd, City = CityUpd, State = StateUpd, ZipCode = ZipCodeUpd, MemberStatus = MemberstatusUpd
FROM MemberList, MemberListUpd
WHERE MemberList.MemberNumber = MemberListUpd.MemberNumberUpd
INSERT ?
DELETE MemberListUpd
-
Update, Delete, Insert (reply)
On 1/8/99 3:15:09 PM, Harold Howeth wrote:
> I am trying to update a SQL database with data from a Wang system. The Wang
> data is dumped to a txt file. I then import it into an update table in SQL
> via Access. Some of the data is new and some of the data is updated
> records. At this point I have been trying to create a script to update and
> add data to a table via the query tool in SQL Then delete data from the
> update table.
I was able to get the UPDATE and DELETE to work but I have
> not figured out how to insert new records at the same time? Can I use an IF
> statement? I will apreciate any help or sample code, Thanks.
UPDATE
> MemberList
Set Name = NameUpd, Address1 = Address1Upd, Address2 =
> Address2Upd, City = CityUpd, State = StateUpd, ZipCode = ZipCodeUpd,
> MemberStatus = MemberstatusUpd
FROM MemberList, MemberListUpd
WHERE
> MemberList.MemberNumber = MemberListUpd.MemberNumberUpd
INSERT
> ?
Insert into Memberlist
values NameUpd, Address1upd, Address2upd, ...
-
Update, Delete, Insert (reply)
On 1/8/99 3:15:09 PM, Harold Howeth wrote:
> I am trying to update a SQL database with data from a Wang system. The Wang
> data is dumped to a txt file. I then import it into an update table in SQL
> via Access. Some of the data is new and some of the data is updated
> records. At this point I have been trying to create a script to update and
> add data to a table via the query tool in SQL Then delete data from the
> update table.
I was able to get the UPDATE and DELETE to work but I have
> not figured out how to insert new records at the same time? Can I use an IF
> statement? I will apreciate any help or sample code, Thanks.
UPDATE
> MemberList
Set Name = NameUpd, Address1 = Address1Upd, Address2 =
> Address2Upd, City = CityUpd, State = StateUpd, ZipCode = ZipCodeUpd,
> MemberStatus = MemberstatusUpd
FROM MemberList, MemberListUpd
WHERE
> MemberList.MemberNumber = MemberListUpd.MemberNumberUpd
INSERT
> ?
Insert into Memberlist
values NameUpd, Address1upd, Address2upd, ...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|