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 |
|
aidmondo
Starting Member
23 Posts |
Posted - 2012-05-12 : 06:17:12
|
| Hi, I'm trying to create an auto generated string Culomn. Need lots of Help. For example, SudentID should in the form S000000000001 S000000000002 |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-12 : 06:28:22
|
| what kind of string do want to store..Can you please let us know the scienerio with data and your required output. |
 |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2012-05-12 : 06:47:11
|
| [code]declare @a varchar(20)set @a = 'S00'declare @i intset @i = 1while (@i <= 100)begininsert into #Mytable (id) values(@a+ cast(@i as varchar(50)))set @i= @i+1endselect * from #Mytable[/code] |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-12 : 19:55:17
|
| we usually implement it by means of computed column based on identity column as specified in article------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
aidmondo
Starting Member
23 Posts |
Posted - 2012-05-13 : 06:38:22
|
| The article helped a lot Thanks. |
 |
|
|
|
|
|