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
Post a Comment