Re: right padding equivalent
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Wed, 28 Jun 2006 22:16:02 +0000 (UTC)
lossed (hundyhunter@xxxxxxxxx) writes:
Please excuse me if this has been asked before or sounds a bit dim.
This is a question asked on another forum but the solutions being
offered are focussing on programming rather than letting the DB server
do the work, which I'm not sure is the most efficient solution.
However, my confession is I dont use SQL server so can't help them
directly with the syntax. Hopefully you can help me help them and learn
a little about SQL Server in the process.
Trying to right pad a first name field so the padded string is a total
of 30 chars. It will be output concatenated with the last name field,
and each field separated with a "|". So that when output it reads
something like:
fname | mylastname
...
Issue: It appears this is padding correctly but the spaces are not
rendering in the browser. (I have no way to check this as I don't use
sqlserver. However, I can understand that multiple spaces are not going
to render in the client browser, if indeed the query is padding with
spaces.
This sounds like an HTML design issue to me. Use a table with an invisible
border, rather than putting and all that stuff in SQL Server.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: right padding equivalent
- From: lossed
- Re: right padding equivalent
- References:
- right padding equivalent
- From: lossed
- right padding equivalent
- Prev by Date: Re: constraint expression for unique keys
- Next by Date: Re: Need help with this select statement
- Previous by thread: Re: right padding equivalent
- Next by thread: Re: right padding equivalent
- Index(es):
Relevant Pages
|