Tech_Men
asked on
update col numbers
hi there ,
i have this col that i want to update
proName (nvarhcar type)
1
2
3
4
i want to update its to :
1001
1002
1003
1004
i try to do this :
update dbo.Products set ProName=1001+1
but its not working
how can i fix that ?
i have this col that i want to update
proName (nvarhcar type)
1
2
3
4
i want to update its to :
1001
1002
1003
1004
i try to do this :
update dbo.Products set ProName=1001+1
but its not working
how can i fix that ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
soryy
what abhot if i have in the ProName :
XXX
YYY
SSS
now how can fix that to :
1001
1002
1003
???
what abhot if i have in the ProName :
XXX
YYY
SSS
now how can fix that to :
1001
1002
1003
???
UPDATE dbo.Products
SET [ProName] = cast((cast(ProName as numeric)+1000) as varchar)
SET [ProName] = cast((cast(ProName as numeric)+1000) as varchar)
ASKER
Error converting data type nvarchar to numeric.
ASKER
i want to set a numeric from number to number
to this fild
even if the fild are filled whit string
to this fild
even if the fild are filled whit string
ASKER
to make a runing number to all rows in the table
if i have 10 rows and i want if to strat from the number 5000
its end in the last row 5009
if i have 10 rows and i want if to strat from the number 5000
its end in the last row 5009
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
set ProName=1000+ProName