SQL Server stored procedure and string manipulations

62 views Asked by At

I want to create a stored procedure in T-SQL which takes an input parameter itemVal which is a string.

This parameter takes values in 4 ways:

  1. item name (name: [pen])
  2. item key (key: [pen_k2])
  3. item GUID (guid: [213314-32434-45757]),
  4. 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 variable @itemVal: item name, item code, item GUID or item key.

0

There are 0 answers