if I have understood your question correctly, you have some working code that validates the SSN and you want to know the best way of implementing it? If that is the case then:
- If you will want to use the logic to return a single value (valid/invalid) in multiple different scenarios e.g. SELECT statements, stored procedures, etc. then create it as a function as that is the most flexible.
- If you only need to use the logic in one place and it is part of a wider piece of functionality that is run regularly (e.g. a process to identify all invalid SSNs and then correct them) then I would incorporate it into a Stored Procedure
CLICK HERE to find out more related problems solutions.