Sunday, March 25, 2012

alfanumeric counters?

Hi there,

T-sql 2005 is offering the possibility to define alfaphanumeric counters? I mean, stuff like this: a,b,c...z, a1, b1...zn...a2..

Is it possible or it must be built for yourself?

I'm awared of IDENTITY function when I ran Sql2k but it doesn't target my goal.

Thanks for your time,

You'll have to build that yourself. The question you need to ask yourself is why do you NEED an alpha-numeric identity. If you plan to process a field differently based on the format of the field then you're getting into the "database within a database" scenario which is bad.|||ok, thanks for that. At the end of the day it was related with Oracle.|||

You could do this in a Data Flow in one of two ways-

1 Use a Script Component, and included in you could also consider a custom component, at the end of the day the code will be the same, just how you package it.

2 Use a Derived Column. You would also need a row number, so either from the source, a script component or the Row Number Transform. Using the row number you could derive the a, a1, c2 etc format you require in the Derived Column using an expression.

|||Thanks Darren

No comments:

Post a Comment