For the column where you want the new value use,
Case when mrc = yyy then xxx end as id
In your select statement that creates the flat file.
John Arnold
(301) 354-2939
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John McKee
Sent: Tuesday, February 12, 2008 11:34 PM
To: Midrange Systems Technical Discussion
Subject: Update a column in a table from a flat file
My earlier question has been resolved. Can't skip a key field in a
database and get decent performance.
Now, I wondering:
Run the Crystal report. Export the rsssults to a flat file. First
field would be a complete primary key to the MS-SQL database. Third
field would be the new value for a single specified field.
One possibility would be to modify the text file to read like this:
update clinical set id= xxx where mrc=yyy
The above line would be modified so that a text file would have several
thousand individual update commands. The file would be input to a
command line program, name eludes me for the moment.
Is there a way to do all the updates with a single command?
John McKee
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.