Lenght of NText field

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Lenght of NText field

    I have been using MSAccess databases when working with CF for the past 8 years.
    The following query or something very much like it has been hugly successful
    in getting PossibleCauses records where the PossibleCauseDesc (memo field) has
    a value stored in it:

    <cfquery name="qryPC" datasource="#sDataSource#">
    SELECT ProblemID, PossibleCauseDesc, Verified, Evidence
    FROM PossibleCause
    WHERE Len(PossibleCauseDesc) > 0
    </cfquery>

    I'm now converting from MSAccess to SQLServer. Since the Memo field becomes
    an NText field when the database is UpSized to SQL Server, I can no longer use
    the Len funciton to determine if the PossibleCauseDesc field has any data in it
    because the NText field holds a pointer to the data rather than the data
    itself. I've looked through all my books on the subject and can not determine
    how to do this query in SQL Server.

    I could work around the problem by eliminating the WHERE clause and determine
    what I want to know after the query is run, but I have to believe that the most
    efficient way to do this is within the Query rather than after the query with a
    <cfloop>.

    Thanks in advance for your suggestion(s).

    :-}
    Len


    PHRED-SE Guest

  2. Similar Questions and Discussions

    1. Retrieve ntext field using ODBC Socket
      Help....! I just upgraded cfmx6.1 to cfmx7, and all queries retrieve ntext field from MS SQL Server fail. It displays nothing or empty string...
    2. SQL Where lenght of data in field GT 'n' characters
      Need a sql where statement to pull only records where field 'ABC' contains more than 2 characters (nvarchar 255 field)
    3. Detecting the lenght of a MEMO field retrieved from a SQL database
      Hi using VBScript, SQL, ASP I would like to show the contents of a memo field but only if it is not empty. I can do this with regular text...
    4. ntext field not showing up (ASP)
      I changed the datatype of a field in a SQL Server 2000 database from nvarchar to ntext, but now nothing is being displayed. The "Body" column of...
    5. Updating part of the text in an NTEXT field
      SQL Server Version - 7 Table - Pages Field - Content Hi, I need to update an ip address in an ntext field. I have looked at UPDATEXT, the...
  3. #2

    Default Re: Lenght of NText field

    Well ...
    A) Do your really need to use a SQL Server 'text' field? In SQL Server 2000
    varchar fields could store up to 8000 characters and nvarchar 4000 characters
    (I believe), which is usually sufficient for storing most types of
    "descriptions".
    B) Do you really need 'ntext' instead of 'text'. (i.e. are you actually
    storing unicode data ?)

    The DATALENGTH() function can be used on ntext fields. See the Transact-SQL
    help for more information.

    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139