Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


ColdFusion SQL Server Query truncating some results

Posted on 2009-02-20
Medium Priority
Last Modified: 2012-05-06
I know there is a simple answer and that I am forgetting something simple, but any help would be appreciated. I am performing a simple query on a table with ids, account numbers and passwords in it.

These passwords were inserted directly into SQL server and are all strong, but they have random special characters in them (for example, a password could be D=aE#45wxy).

I am running a query via ColdFusion to pull the passwords and encrypt them. When I run a simple query to select all from the table, some passwords are truncated (for example, they will just show a part of the password).

I talked to the database guy and he assured me that all the passwords are strong and have the right amount of characters. I'm thinking the truncation is due to certain conflicting special characters (maybe quotes or pound signs - I don't know - it is strange because there are passwords displaying that have a pound sign in them, or a greater than or less than sign).

Can anyone think of the obvious thing I'm missing here to return the text in the SQL server database?
<cfquery name="getPass" datasource="dbName">
	select * from tableName
	order by id asc
<cfoutput query="getPass">		
#id# #password# <br>

Open in new window

Question by:liltyga
LVL 19

Accepted Solution

Jones911 earned 2000 total points
ID: 23694184
Write it to a file.  You'll probably find its turnign some of the funny chars into HTML.

or try:


<cfoutput query="getPass">              
#id# #HTMLCodeFormat(password)# <br>
LVL 19

Expert Comment

ID: 23694244
what you can do is try dumping the query first before you output
<cfdump var="#getPass#">

Author Closing Comment

ID: 31549340
Thanks so much Jones911 - you are exactly right - the HTMLCodeFormat worked like a charm!!!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

564 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