I haven't coded any of my personal apps in ages
. Been working in the banking industry now for 2 years.
Also I am not entirely sure what my ability to code as to do with my intelligence. Meh. So what do you do for a living then? Last I saw you, you were bent on ruining MTM2 for everyone, how have you changed then?
And well actually if u wanna help, perhaps you can help with this.
Quote:
My problem is simple. The first character of a piece of data in a column may be invalid. I need a script to fix it. Preferably not using a stored procedure.
My first idea was this
Update Service10
Set LN_SmString2 = ('M' + RIGHT((Select LN_SmString2 From Service10),Len(Select LN_SmString2 From Service10) - 1)))
Where LEFT(LN_SmString2,1) <> 'M' or LEFT(LN_SmString2,1) <> 'S' or LEFT(LN_SmString2,1) <> 'D'
I've bolded the specific problem, how do I tell it which row to grab the data, the select and the update need to be looking at the same row for this to work.
If there is an easy solution to this, I'd like to know.
Otherwise, my solution would be using a variable and a curser. That should work fine EXCEPT I only know how to use variables and cursors in stored procs. I again, don't want a stored proc, just a single use script. Online help is not very helpful for some reason with this issue, so help would be appreciated.
The jyst of this script is this.
If the first characters is not M, S, or D, then make it M. All characters after that must remain the same. It is a 30 character CHAR and each character represents something to the system.