Question
Read nvarchar(max) field in SQL 2005 system views
In SQL Query Analyzer or Management Studio, connect to a SQL
2005 server, and execute the following query:
select top 5 definition from sys.default_constraints
The result is something like
definition
-----------------
(0)
('')
('')
(0)
(0)
(5 row(s) affected)
Now try the same thing in coldfusion. (Of course, you will have to use your own datasource name):
---------- start of code ----------
<cfquery name="GetConstraintDefinition" datasource="sqlchap">
select top 5 definition from sys.default_constraints
</cfquery>
<cfdump var="GetConstraintDefinition">
<cfdump var=#GetConstraintDefinition#>
---------- end of code ----------
When run, the result is something like this:
GetConstraintDefinition query - Top 5 of 5 Rows
DEFINITION
1 [empty string]
2 [empty string]
3 [empty string]
4 [empty string]
5 [empty string]
Can anyone duplicate this misbehavior, and possibly suggest why this might be happening? The "definition" field in sys.default_constraints is an nvarchar(max) field. I have tried checking various datasource options without success. Even more interesting is that if I select an nvarchar(max) field out of one of my own tables, the data comes back just fine.
I am running ColdFusion MX version 7,0,2,142559 on Windows XP. It doesn't seem to matter whether I use the Microsoft SQL Server 2005 JDBC Driver, or the standard SQL Server Driver.
Any ideas welcome!
select top 5 definition from sys.default_constraints
The result is something like
definition
-----------------
(0)
('')
('')
(0)
(0)
(5 row(s) affected)
Now try the same thing in coldfusion. (Of course, you will have to use your own datasource name):
---------- start of code ----------
<cfquery name="GetConstraintDefinition" datasource="sqlchap">
select top 5 definition from sys.default_constraints
</cfquery>
<cfdump var="GetConstraintDefinition">
<cfdump var=#GetConstraintDefinition#>
---------- end of code ----------
When run, the result is something like this:
GetConstraintDefinition query - Top 5 of 5 Rows
DEFINITION
1 [empty string]
2 [empty string]
3 [empty string]
4 [empty string]
5 [empty string]
Can anyone duplicate this misbehavior, and possibly suggest why this might be happening? The "definition" field in sys.default_constraints is an nvarchar(max) field. I have tried checking various datasource options without success. Even more interesting is that if I select an nvarchar(max) field out of one of my own tables, the data comes back just fine.
I am running ColdFusion MX version 7,0,2,142559 on Windows XP. It doesn't seem to matter whether I use the Microsoft SQL Server 2005 JDBC Driver, or the standard SQL Server Driver.
Any ideas welcome!