October 27, 2014 at 8:10 am
How to limit the length of a database field such that only first 12 characters are shown in the result?
For example, I have show the only first 12 characters of employee name.
October 27, 2014 at 8:13 am
SELECT
LEFT(Employee_Name , 12) as 'Employee First 12'
from tbl_Employees
October 27, 2014 at 8:13 am
Do you want to limit the actual number of characters in the database or just the number of characters that get displayed?
October 27, 2014 at 11:30 am
That's really best done on the client, but the LEFT string function will work.
----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply