Monday, June 14, 2010

Replicate / Padding in SQL server

Right or left padding in SQL server. Use Replicate for this...

PRINT REPLICATE('-', 10 - LEN('TABLE'))+'TABLE'

PRINT 'TABLE' + REPLICATE('-', 10 - LEN('TABLE'))

No comments:

Post a Comment