December 22, 2017 at 1:53 am
Hi All,
I have records stored in a table in below formats . Want the result in an arranged format as shown below. I tried with substring but not get it as required. Can anyone help to get it done.
Description
------------------------------------------------------------------------------------------------------------------------------------------------
String '33417' does not match regex pattern '^[0-9]{5}([ -]?)[0-9]{4}$'. Path 'Draft1[38]['Emp Code']', line 638, position 125.
Invalid type. Expected String, Numbers have Null. Path 'Draft1[1].DOB', line 131, position 11.
String ' ' does not validate against format 'date-time'. Path 'Draft1[40]['Hire Date']', line 47, position 5.
Invalid type. Expected String, Number Null. Path 'Draft1[124].DOB', line 1004, position 179.
String '69316' does not match regex pattern '^[0-9]{4}([ -]?)[0-9]{4}$'. Path 'Draft1[13]['Emp Name']', line 1364, position 215.
Result should be like
Description
------------------------------------------------------------------------------------------------------------------------------------------------
In Document 'Draft1 - Column['Emp Code'] - Row Number[38]'. --> String '33417' does not match regex pattern '^[0-9]{5}([ -]?)[0-9]{4}$'.
In Document 'Draft1 - Column.DOB - Row Number[1]'. --> Invalid type. Expected String, Numbers have Null.
In Document 'Draft1 - Column['Hire Date'] - Row Number[40]'. --> String ' ' does not validate against format 'date-time'.
In Document 'Draft1 - Column.DOB - Row Number[124]'. --> Invalid type. Expected String, Number Null.
In Document 'Draft1 - Column['Emp Name'] - Row Number[13]'. --> String '69316' does not match regex pattern '^[0-9]{4}([ -]?)[0-9]{4}$'.
Thanks,
Anand
December 22, 2017 at 2:21 am
I'm honestly not sure SQL Server is the correct answer to doing this. This is going to take A LOT more than a SUBSTRING. Especially if that error is stored in a single column.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
December 22, 2017 at 6:05 am
mk.kamalanand - Friday, December 22, 2017 1:53 AMHi All,I have records stored in a table in below formats . Want the result in an arranged format as shown below. I tried with substring but not get it as required. Can anyone help to get it done.
Description
------------------------------------------------------------------------------------------------------------------------------------------------
String '33417' does not match regex pattern '^[0-9]{5}([ -]?)[0-9]{4}$'. Path 'Draft1[38]['Emp Code']', line 638, position 125.
Invalid type. Expected String, Numbers have Null. Path 'Draft1[1].DOB', line 131, position 11.
String ' ' does not validate against format 'date-time'. Path 'Draft1[40]['Hire Date']', line 47, position 5.
Invalid type. Expected String, Number Null. Path 'Draft1[124].DOB', line 1004, position 179.
String '69316' does not match regex pattern '^[0-9]{4}([ -]?)[0-9]{4}$'. Path 'Draft1[13]['Emp Name']', line 1364, position 215.Result should be like
Description
------------------------------------------------------------------------------------------------------------------------------------------------
In Document 'Draft1 - Column['Emp Code'] - Row Number[38]'. --> String '33417' does not match regex pattern '^[0-9]{5}([ -]?)[0-9]{4}$'.
In Document 'Draft1 - Column.DOB - Row Number[1]'. --> Invalid type. Expected String, Numbers have Null.
In Document 'Draft1 - Column['Hire Date'] - Row Number[40]'. --> String ' ' does not validate against format 'date-time'.
In Document 'Draft1 - Column.DOB - Row Number[124]'. --> Invalid type. Expected String, Number Null.
In Document 'Draft1 - Column['Emp Name'] - Row Number[13]'. --> String '69316' does not match regex pattern '^[0-9]{4}([ -]?)[0-9]{4}$'.Thanks,
Anand
Help us help you. See the first link under "Helpful Links" in my signature for how to post readily consumable data and post your code so we can try to figure out what you're really trying to do. It looks like you may have a pretty decent data validation system/bulk log staging table setup but it's difficult to advise you how to format your "validation failed" messages without you posting your code.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply