List box control with multiple selectable values
Example multilistbox procedure. As you can see, the procedure is identical to that of a dropdown and should be named accordingly. This way the field type can be changed without having to rename the procedure.
CREATE PROCEDURE Example.MultiListBoxTable_Dropdown AS BEGIN SELECT MLBT.MultiListBoxTableId, MLBT.MultiListBoxTableName FROM Example.MultiListBoxTable MLBT ORDER BY 2 END
The name depends on the usage. If the control is used to retrieve values from a lookup table then the procedure should be named "<Schema>.<LookupTable>Dropdown". If it is not and the values are not directly linked to rows in a table or the functionality is specific for the current field (say for instance a choice between each of the last six years) then the procedure should be named "<Schema>.<Table><Field>_Dropdown".
The suffix "_Dropdown" should be used since the control works exactly like a dropdown regarding result sets from the SQL call and naming the procedure in that way enables you to change field type without renaming the procedure.
For stable and predictable behaviour, always use an explicit ORDER BY clause.