Here's the procedure for pulling up a patient from table: CREATE PROCEDURE getpatient_byln @ln varchar(50)ASSelect visit_id, last_name, first_name, birthdate, sex, area, room_bed, admit_date, weight_kg, medical_service, attending_doctorfrom TBL_ADTwhere last_name like @ln+'%' order by last_name, first_name
This works great usually. However if you have a last name that is a SQL keyword like Cross, it bombs with this error:Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'cross'. /pharmdoc/getpatient/getpatient2.asp, line 51 I tried putting some single quotes around the entry but it still fails. Any ideas how to fix this?