Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9021939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:22:38+00:00 2026-06-16T05:22:38+00:00

I am using sql server database drivers in codeigniter and I am executing the

  • 0

I am using sql server database drivers in codeigniter and I am executing the following query:

 select A.inst_name,Substring((Select ',' + cast(B.program_id as varchar(15))   
                               From    k12_dms_inst_programs B
                               Where B.inst_id=A.id For XML Path('')),2,8000) As EmployeeList
 From k12_dms_institution_master A
 Group by A.inst_name,A.id

which is working absolutely fine in SSMS.

But when I am trying to execute the same query using Codeigniter I am getting the following error:–

Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:22:39+00:00Added an answer on June 16, 2026 at 5:22 am

    Found some solutions on php.net

    1. MSSQLNewbie 19-Sep-2011 06:34

      In /etc/freetds/freetds.conf add these two lines (last two):
      [global]
      ;tds version = 4.2
      tds version = 8.0  
      client charset = UTF-8
      
      You can edit "charset" in php.ini too (but you don't need if you did it previously in freetds.conf):  
      ; Specify client character set.. 
      ; If empty or not set the client charset from freetds.comf is used 
      ; This is only used when compiled with FreeTDS mssql.charset = "UTF-8"
      
      Use nchar/nvarchar/ntext column types if you need unicode support.
      
    2. dann dot farquhar at iteams dot org 24-Sep-2009 11:45

      I found that changing the version in /etc/freetds.conf from 4.2 to 8.0
      fixes this problem without having to make any changes to the SELECT
      statement
      
    3. huberkev11 at hotmail dot com 12-May-2006 01:47

      This is because you are using column types of like ntext instead of
      text.  There are 2 solutions.
      
      1  Change all ntext column types to text or
      2  Your query must look like: SELECT CAST(field1 AS TEXT) AS field1 FROM table
      

    Hope they will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using classic asp, I am trying to query a SQL Server database like so:
I'm using pyodbc to query to an SQL Server database import datetime import pyodbc
I'm using a SQL Server database, I'm working on a real estate website. I
I am using a SQL Server database in my current project. I was watching
I am using SQL Server CE database and C# language. I have a table
I'm using a SQL Server database in my program with Linq-to-SQL I'm using this
I'm wondering what the key differences between using a SQL Server Compact database (
I have a web application, which is using a SQL Server 2005 database. My
For our SQL Server database, we're using a versioning scheme to track schema updates.
I'm using Microsoft SQL Server for my database. There is an ID column in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.