Restricting the size of a column in SQL

Posted on 2011-03-14
Medium Priority
Last Modified: 2012-05-11

When I do a normal query the disply shows the default size of the column , can I restrct the size of the column to less than the default for dislay alone .
Question by:FranklinRaj22
  • 2
LVL 17

Expert Comment

by:Daniel Reynolds
ID: 35132700
If it is only for display, change the SELECT of the data to only grab say the first 30 characters instead of all characters.

something like...

SELECT LEFT(myColumn,30) AS [myCoilumn]
  FROM myTable
LVL 17

Accepted Solution

Daniel Reynolds earned 2000 total points
ID: 35132709
Sorry, got mixed up here.

If you are using sql you would use
SELECT SUBSTRING(myColumn, 0, 30)
  FROM myTable


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question