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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Is it substring and ... I should be using??

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2008-08-07 : 12:27:12
I have a string thats always 9 characters long, I am only selecting the first 8 characters but want to learn how to add a character at a defined location like the following:

Right now doing:

substring(ms.cusip,1,8) as newcusip

and getting

060505HH

and want to build this

0605059HH

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-07 : 12:38:32
i think what you want is STUFF function
http://doc.ddart.net/mssql/sql70/setu-sus_16.htm
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2008-08-07 : 12:43:56
THAT WORKS, THANKS MUCH
Go to Top of Page
   

- Advertisement -