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'
fromtbl_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 Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply