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 |
|
svicky9
Posting Yak Master
232 Posts |
Posted - 2006-06-28 : 12:16:34
|
| Hi FriendsI have a table which i want to enter one of the columns likeLB01LB02LB03I want to create the identity with the coloumhow do i proceedVic |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-06-28 : 12:19:59
|
| identity has to be numeric.If LB is a constant why hold it in the table - just think of it as a client thing to concatenate.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2006-06-28 : 12:30:07
|
| Basically you can't create a non-integer identity column but you can try the following workaround:create table #test( a int identity(1,1), -- only for internal reference b as (case when isnull(a,0) < 10 then 'LB0' else 'LB' end) + convert(varchar(50),isnull(a,0)), -- this will be the column you use...)The trick here is to use computed column. I hope i am clear !Harsh AthalyeIndia."Nothing is Impossible" |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2006-06-28 : 13:43:19
|
quote: Originally posted by svicky9 Hi FriendsI have a table which i want to enter one of the columns likeLB01LB02LB03I want to create the identity with the coloumhow do i proceedVic
How do you proceed...by giving us more info..Read the hint link in my sig, and post what it asks forBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-29 : 01:38:49
|
quote: Originally posted by svicky9 Hi FriendsI have a table which i want to enter one of the columns likeLB01LB02LB03I want to create the identity with the coloumhow do i proceedVic
See if this helpshttp://www.sqlteam.com/forums/topic.asp?TOPIC_ID=57069MadhivananFailing to plan is Planning to fail |
 |
|
|
svicky9
Posting Yak Master
232 Posts |
Posted - 2006-06-29 : 08:25:14
|
| Thanks Madhivanan ...your post seems to be helpfulVic |
 |
|
|
|
|
|