SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 function
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mateenmohd
Constraint Violating Yak Guru

United Arab Emirates
297 Posts

Posted - 05/26/2007 :  09:57:27  Show Profile
what function will use to add P in the user_id data ?


user_id type varchar

ie.
user_id
--------
012345
014153
016464
...

add P before the user_id i.e.

user_id
--------
p012345
p014153
p016464
...

regards
Mateen

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 05/26/2007 :  10:34:11  Show Profile  Visit spirit1's Homepage
update YourTabel
set user_id = 'p' + user_id

if this causes a truncation of some data you'll have to increase the column length first.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22754 Posts

Posted - 05/26/2007 :  10:40:25  Show Profile  Send madhivanan a Yahoo! Message
Alternatively, you can add that when selecting data

Select 'p'+user_id as user_id from table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

mateenmohd
Constraint Violating Yak Guru

United Arab Emirates
297 Posts

Posted - 05/26/2007 :  10:43:07  Show Profile
thanks you very much.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000