Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format results - Column Width

Status
Not open for further replies.

ADW

Programmer
Jun 21, 2001
50
GB
In some of my SQL statements, the column length that is returned is incredibly wide in comparison with the result. How can I format the column width?
 
Hi there,
When you run a T-SQL statement SQL returns you the columns value with maximum possible value of that column. That is, if you are having a column of varchar(255) having data 'ABCD'.
Still SQL will return you a string of varchar(255).
For formatting of data you can use RTRIM(myColumn) or some other string functions. But these will return the formatted data only in the front-end other that Query Analyzer.

Let us know what data value you have and what you want sql to return.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top