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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Column and Data size

Status
Not open for further replies.

chester27

IS-IT--Management
Apr 29, 2002
208
GB
Hi

How do I truncate the length of a data entry in a column. Column set to nvarchar (20) but column for import in set to MAX. I want to import these records but truncate them to max of 20 for that column only.
 
cast(columnNams as nvarchar(20))

--------------------
Procrastinate Now!
 
And is the data your importing always 20 characters or less?? Or do you not care about the rest of the data?
Do you have any control over the imported data? If you do, I would say to whom ever, please limit whatever field to nvarchar(2).
 
I may be misunderstanding but LEFT(incoming, 20) might work.

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top