Solved

Restricting the size of a column in SQL

Posted on 2011-03-14
2
296 Views
Last Modified: 2012-05-11
Hi,

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 .
0
Comment
Question by:FranklinRaj22
  • 2
2 Comments
 
LVL 17

Expert Comment

by:xDJR1875
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
0
 
LVL 17

Accepted Solution

by:
xDJR1875 earned 500 total points
ID: 35132709
Sorry, got mixed up here.

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

                                                           
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now