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 |
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-11-22 : 00:36:10
|
| i have following situation @a varchar(10)@b intset @a='00001'set @b=1set @a=cast (@a as int ) + @bnow in @a value is 2but i want 00002can suggest me some solutions for this regardsdasu.g |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-11-22 : 02:08:36
|
| [code]DECLARE @a varchar(10)DECLARE @b intset @a='00001'set @b=1set @a=cast (@a as int ) + @bSELECT [@a] = @aset @a='00001'set @b=1set @a= RIGHT('00000' + CAST(cast (@a as int ) + @b AS varchar(5)), 5)SELECT [@a] = @a[/code]Kristen |
 |
|
|
|
|
|