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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -