ColdFusion SQL Server Query truncating some results

Posted on 2009-02-20
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

    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

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

    Author Closing Comment

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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    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…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now