我正在使用 SQL Server 2005。在其中一个表中,我有一列“xmldefinition”,它是 ntext 类型。现在该列中的数据非常庞大并且包含整个 xml 文本。
例如:- ....
我想从 Management Studio 获取整个字符串并将其复制到 xml 文件中只是手动浏览整个 xml。但是,当我查询此列并将数据复制并粘贴到另一个文件中时,内容在中间被破坏并且不完整。
例如:- ........
我相信这只会从列中的 xml 数据中复制一些 8196 个字符。所以我的问题是,如何手动获取该列的完整数据。不过,我可以编写 C# 代码来阅读该专栏,但我想在 Management Studio 中手动执行此操作。有什么想法请。
I am using SQL server 2005. In one of the tables, I have a column "xmldefinition" which is of ntext type. Now the data in this column is very huge and contains whole xml text.
eg:- <root><something1>....</something1></root>
I want to get the whole string from management studio and copy it outside in a xml file just to go through the whole xml manually. But when I query for this column and I copy and paste the data into another file, the contents are broken in middle and it is not complete.
eg:- <root><something1>........<somechar
I believe this will copy only some 8196 characters from xml data in column. So my question is, how do I get the complete data for this column manually. I can however write a C# code to read that column, but I want to do this manually in management studio. Any idea please.
发布评论
评论(3)
SQL Server 截断和 8192 限制 中显示的导出技术对我有用。总之,它说:
您可以将数据导出到不会被截断的平面文件。为此:
其余步骤应该是不言自明的。这会将文件输出为文本,您可以在您喜欢的文本编辑器中打开它。
The export technique shown in SQL Server truncation and 8192 limitation worked for me. In summary it says:
You can export the data to a flat file which will not be truncated. To do this:
Remaining steps should be self explanatory. This will output the file to text and you can open it in your favorite text editor.
为什么不在 select 语句中将数据从 NText 转换为 XML?然后,您可以选择在 SSMS 内的单独窗口中打开 XML。
Why not convert the data from NText to XML in your select statement? Then you get the option of opening up the XML in a separate window within SSMS.
一般来说,超过此限制的唯一方法是通过 XML。对于长 varchar 列,我通常使用类似以下内容的内容(处理指令技巧避免将
<
更改为<
等)当然,在您的情况下,数据已经是 XML,所以一个简单的转换应该可以工作!
The only way of exceeding this limit in general is via XML. For long varchar columns I normally use something like the following (the processing instruction trick avoids
<
being changed to<
etc.)Of course in your case the data is already XML so a simple cast should work!