We have an application that uses the following query to get information
 about tables in a SQL Server database.  Everything (Perl, SQL Server, &
 web server) runs under Windows.  The name of the table ($table_name) is 
 usually input from a web form.  The column names returned by the query
 are used to build other queries.

        $table_query = "SELECT b.colorder, b.name, c.name
                FROM sysobjects a, syscolumns b, systypes c, systypes d
                WHERE a.id = b.id
                   and a.name = '$table_name'
                   and user_name(a.uid) = '$owner'
                   and b.xtype = c.xusertype
                   and b.xusertype = d.xusertype
                ORDER BY b.colorder";

 The problem occurs if the table name entered or a column name in that
 table contains characters outside the range of 8-bit ASCII characters,
 for example, the Euro symbol.  This symbol (Unicode character #8364
 for those interested) is perfectly fine as an object name in  SQL Server,
 but if I print the results of the above query, the Euro symbol is printed
 as a question mark.

 I guess the question is then, how do I keep the Unicode data intact from
 SQL Server -> DBI -> Perl -> Web and back?

 Thank you,
 glen accardo
 BMC Software

 

Reply via email to