Hi All,I need to write a SP which will insert/delete/edit a series of 'routes' for holiday destinations.I have two tables:cb_Routes > ID (PK, int)FromID (int)ToID (int)cb_Airport >ID (PK, int)CodeNameThe [FromID] and [ToID] in cb_Routes are simply ID's from the cb_Airport table. What I want is my SP to update the cb_routes table (ie. the ID's) but display the 3 letter from cb_Airport.I have this as my SELECT:[code]SELECT R.ID AS [ID], A.Code AS [FROM], A2.Code AS [TO] FROM dbo.cb_Route AS R INNER JOIN dbo.cb_AirportCities AS AC ON R.ToID = AC.AirportID LEFT OUTER JOIN dbo.cb_Airport AS A ON R.FromID = A.ID LEFT OUTER JOIN dbo.cb_Airport AS A2 ON R.ToID = A2.ID WHERE (A.Code IS NOT NULL) GROUP BY R.[ID], A.Code, A2.Code ORDER BY [FROM]
As I said above, I need my update (and delete) statements to update/delete the record from the cb_Routes table but have the 3 letter cb_Airport.[Code] as the 'display field' in my .NET form.Anyone got any ideas?Thanks in advance,Brett