Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
slboytoy
Starting Member
30 Posts |
Posted - 2005-03-23 : 12:46:28
|
| I'm trying to update a column, if the number is or has a revision. I've been playing around all morning. I can do it with activeX, but that would be a performance hit I beleive. Would be nice if T-SQL could do this.10001005103010551055R11055R2106010891089R110901096-- R means revision --Covert to...1000100510301055 Y1055R1 Y1055R210601089 Y1089R110901096Here is what I have played with.1. Group by Substring(number, 0, 5) or Len(number > 5) or Substring(number, 5, 1) = 'R'2. Counts that are bigger then one, you know there is more then one record. use results to update columns to 'Y'3. use max(number) to find the most current number and set the column back to blank. |
|
|
PW
Yak Posting Veteran
95 Posts |
Posted - 2005-03-23 : 13:12:32
|
| This is what happens when you throw normalization out the window in db design.You have a "number" (1 piece of data) and a revision number to it (a separate piece of data). These should be in 2 separate columns, not in a concatenated column with overloaded meanings depending on presence of an 'R' at a certain location. |
 |
|
|
slboytoy
Starting Member
30 Posts |
Posted - 2005-03-30 : 12:24:15
|
| I want to add a revision indicator.1233R13R245Those are my 7 quote numbers. 3 was the first quote, there was a revision on it. (3R1). And there was a revision on 3R1 (3R2). The rest don't have any revision, they are the latest quotes numbers.So I want to add a flag on 3 and 3R1 to say they are revision.Does that Help ? |
 |
|
|
|
|
|