I fixed this. Thanks.
Problem was with a filter I was passing as an argument, like:
sp_test "NAME='O'BRIEN'"
should have been:
sp_test "NAME='O''BRIEN'" -- forgot to add additional single quotes
The Stored Procedure in turn uses an EXEC, with the filter:
EXEC( 'select * from test where ' + filter )
Bharat Sanghvi
Vice President, Information Technology
Deyta
Continuous Quality Measurement Systems