Here is one way (of many):
Declare @len int;
Declare @value varchar(10);
--Set @value = '4567890';
Set @value = '1234567890';
Set @len = len(@value);
Select @value, stuff(stuff(right('000' + @value, 10), 7, 0, '-'), 4, 0, '-');
Jeff
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs