EazyWorks
asked on
MS SQL Update Script
I need to update a Alpha Numeric Syntax to include a couple more Digits.
In RegEx the Syntax is
new Regex("^[A-Z]{2,}\\d{2}-\\ d{6}$")
I want to do a SQL statement to update this to
new Regex("^[A-Z]{2,}\\d{2}-\\ d{9}$")
A couple examples
AA10-123456
BB01-654321
updated to
AA10-000123456
BB01-000654321
If I can just execute a script it would be ideal, but please let me know what you think.
I also would like to search and replace a Text string that might contain several of these numbers.
If I cannot find a nice script I will make a c# function to do it.
In RegEx the Syntax is
new Regex("^[A-Z]{2,}\\d{2}-\\
I want to do a SQL statement to update this to
new Regex("^[A-Z]{2,}\\d{2}-\\
A couple examples
AA10-123456
BB01-654321
updated to
AA10-000123456
BB01-000654321
If I can just execute a script it would be ideal, but please let me know what you think.
I also would like to search and replace a Text string that might contain several of these numbers.
If I cannot find a nice script I will make a c# function to do it.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
SET ColumnName = SUBSTRING(ColumnName,1,Cha
Is there any way I can run a Regular Expression for the where and the Update?
javascript:void(toggleRich