How to fill number of remaining character in string using SQL Server -


currently have following query add remaining leading character in string

print replace(str('9009',8),' ','x') 

output

xxxx9009 

i need output

9009xxxx 

please there builtin function available in sql server 2008

you can use substring:

 declare @s varchar(30) set @s = 'xxxx9009'; select  substring (@s ,5 , 4)  + substring (@s ,1 , 4) 

result:

9009xxxx 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -