|
yogaboy -> RE: multiple databases with fields (1/17/2006 17:59:29)
|
Hi, I'm looking at my posts and thinking I wasn't getting a lot of sleep, perhaps that's why I was writing such rubbish (I'm not getting a lot of sleep now either!) You could try this instead of my crackpot posts from earlier. Add 8 description fields to the Vehicles table, 1 for each of the codes. ie o1, desc1, o2, desc2, o3, desc3.... then run a delete statement to clear the previous info (since you say you don't need it?) DELETE from Vehicles DELETE from OPTIONS Then add the new data to the tables. Then you could run 8 update statements like UPDATE VEHICLES SET desc1 = OPTIONS.bb FROM VEHICLES v INNER JOIN OPTIONS ON OPTIONS.aa = v.o1 UPDATE VEHICLES SET desc2 = OPTIONS.bb FROM VEHICLES v INNER JOIN OPTIONS ON OPTIONS.aa = v.o2 .... then you could do SELECT stocknumber, desc1, desc2 etc from vehicles i've tested this on a SQL Server 2000 database and it works, so if you fiddle around a bit it I reckon it'll work. Sorry for the sloppy code above, I really wasn't getting much sleep.[:(]
|
|
|
|