vendredi 28 juillet 2017

SQL - How can I use a Select based on the parameter

I've got a sql statement in a SQL Server stored procedure using a where clause like this: Select (fields) From Table Where Testname like @SearchLetter + '%'

I need to do check the parameter @SearchLetter and if it's "#", I need to make the parameter choose records that the field 'Testname' starts with a numeric field (0-9)

I've tried several things (ifs/selects, etc.) but I can't seem to get what I need.

anyone know how I can do this?

Aucun commentaire:

Enregistrer un commentaire