Hi, I have the following tables. CREATE TABLE LOOKUP ( KEY CHAR(2) ,COL1 CHAR(1) ) INSERT INTO LOOKUP VALUES ('00','A'),('01','B'),('10','C'),('11','D') CREATE TABLE DATA ( KEY CHAR(2) ,A INT ,B INT ,C INT ,D INT ) INSERT INTO T2 VALUES ('00',1,2,3,4),('01',5,6,7,8) Ihave to lookup each key from DATA table in the LOOKUP table and pickColumns A,B,C or D according to it to get my actual data. Somebodysuggested I could do this using Dynamic SQL. Any help would beappreciated. Thanks.