I want to create a stored procedure in T-SQL which takes an input parameter itemVal
itemVal is a string parameter .This parameter takes values in 4 ways:
- item name (name: [pen])
- item key (key: [pen_k2])
- item GUID (guid: [213314-32434-45757]),
- itemCode (code: [12435])
I have declared @itemVal
in the stored procedure. Any user can provide the value in any of the four forms stated above. How I can parse this string in my stored procedure so that it can do the further procedure. As if it is an item name there is a separate procedure to follow. I want to know what users have provided for input variables: item name, item code, item GUID, or item key.
And how to validate this input parameter.
something like if @cropVal is NOT NULL
{{ call a function to pass the cropVal to parse }
Answers
Sean Quigley | Product Support Engineer | Redgate Software
Have you visited our Help Center?