title: SQL Validating a string variable
body: <p>Using SQL Scripts, I need to validate Comma Separate value. How should i validate the String Variable ?  </p>
  
  <p>Validation should be both Right / Left Trim for each value and there should not be any special characters such as Comma or Period for the last value.</p>
  
  <pre><code> create table #test
   (col varchar(100))
  
   insert into #test values
   ('1,2'),
   ('1,2,'),
   ('1,'),
   ('1,2,3,4,5')
  
  
   select * from #test
  </code></pre>
  
  <p>In the above query, for the second value - Expected Result is 1,2
  In the above query, for the Third value - Expected Result is 1</p>