I was given a few thousand records of varchars such as the one above. They all need to be 10 characters, and I guess they just indiscriminately padded zeros on them. How can I move the negative sign over to the left so
Something like this should do. If they aren't already padded correctly let us know and we can stuff those.
declare @v varchar(64) = '000-575.33' select case when CHARINDEX('-',@v) > 1 then '-' + replace(@v,'-','') else @v end