Hi All,

From a table I am getting the length of character in a column. My query is below

SELECT b.[file_id],b.[lineno],b.fileContent, datalength(b.fileContent) Length1
FROM FileBascContent b join filebasic on filebasic.[file_id]=b.[file_id]
WHERE substring(b.fileContent,1,4)
not in('VOL1','HDR1','UHL1','UTL1','HDR2','EOF1','EOF2') and filebasic.[file_id]=347

I am getting the result 98, 97 and 100 which is fine for me.

Is there any way which will add space 2 or 3 and the length will be 100. Which I want is that all the length which are not 100, should be hundred.

Is there any way to do that?

Please help!

Just make your column a char(100)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.