delete char | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

delete char

how to delete initial 2 characters in a column which is primarykey and varchar datatype.
send me the query

Update customers set customerid = right(customerid,len(customerid)-2) will do but before that you need to check the forenkey constraint and change all the others well —————————————-
http://spaces.msn.com/members/dineshasanka

or Update youtable set yourcol = substring(yourcol,3,len(yourcol)) If it is for display only then Select substring(yourcol,3,len(yourcol)) from yourtable
Madhivanan Failing to plan is Planning to fail
Another way would be
Update customers set customerid = STUFF(customerid,1,2,”)

Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt?http://www.insidesql.de/blogs

]]>