473,671 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML, schema collection and "large value types out of row" problem

Hello,

I have a problem with XML schema update for one XML column (problem
exists in both SP1 and SP2 for SQL Server 2005).

1. I have a table that looks like this:
CREATE TABLE [dbo].[tProduct](
[ProductId] [uniqueidentifie r] NOT NULL DEFAULT (newid()),
[Caption] [nvarchar](500) NOT NULL,
[XMLName] [xml] NULL,
[XMLBlob] [xml](CONTENT [dbo].[ProductInputXml]) NULL,
[SyncDate] [timestamp] NULL,
CONSTRAINT [PK_tProduct] PRIMARY KEY CLUSTERED
(
[ProductId] ASC
))

2. I have to update the xml schema for XMLBlob. The datalength inside
XMLBlob is bigger than 8060, that is why it is stored as follows::
EXEC sp_tableoption N'dbo.tProduct' , 'large value types out of row',
1;

3. I create a backup table, move XML to the backup table, alter the
column data type to regular xml, drop schema and create a new one.
Then I bind the column to the xml schema collection. (Here I do not
care about XMLName column)

CREATE TABLE dbo.tProductBac kup(
[ProductId] [uniqueidentifie r] NOT NULL,
[XMLBlob] [xml] NULL
)
GO

EXEC sp_tableoption N'dbo.tProductB ackup', 'large value types out of
row', 1;
GO

INSERT INTO dbo.tProductBac kup(ProductId, XMLBlob)
SELECT ProductId, XMLBlob
FROM dbo.tProduct;
GO

UPDATE dbo.tProduct
SET XMLBlob = NULL, XMLName = NULL;
GO

ALTER TABLE dbo.tProduct
ALTER COLUMN XMLBlob XML
GO

IF EXISTS (SELECT * FROM sys.xml_schema_ collections c, sys.schemas s
WHERE c.schema_id = s.schema_id AND (quotename(s.na me) + '.' +
quotename(c.nam e)) = N'[dbo].[ProductInputXml]')
DROP XML SCHEMA COLLECTION [dbo].[ProductInputXml]
GO

CREATE XML SCHEMA COLLECTION [dbo].[ProductInputXml]
AS '.... xsd ....'
GO

ALTER TABLE dbo.tProduct
ALTER COLUMN XMLBlob XML(dbo.Product InputXml)
GO

EXEC sp_tableoption N'dbo.tProduct' , 'large value types out of row',
1;
GO

4. When I try to update the original table I get the error message:

UPDATE dbo.tProduct
SET XMLBlob = b.XMLBlob
FROM dbo.tProduct, dbo.tProductBac kup b
WHERE dbo.tProduct.Pr oductId = b.ProductId
GO

Msg 511, Level 16, State 1, Line 1
Cannot create a row of size 8064 which is greater than the allowable
maximum of 8060.
The statement has been terminated.

Can anybody see what is wrong here?

/Ed

Mar 21 '07 #1
0 2389

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6502
by: Russ Perry Jr | last post by:
I'm using "ID" and "Value" in the generic sense here... Let's say one page I had a <html:select> with a collection like this: <html:options collection="items" property="key" labelProperty="value"/> In this case "key" is what I mean by "ID", and "value" is what I mean by "Value" -- the "Value" is shown to the user, but the "ID" is what I plan to keep, to be saved to a database (as a reference in a table to a common table as a part of...
4
5225
by: Grzegorz Dostatni | last post by:
Good morning. I've got a Tkinter problem: File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 2310, in selection_present return self.tk.getboolean( TclError: expected boolean value but got "" Now a few weeks ago there was a similar problem with the boolean value. That's when the tcl started returning "???" for unknown fields in a
8
17042
by: Adam Nemitoff | last post by:
Is is possible to construct a SELECT statement that contains a WHERE clause that uses the value from a column in the "next" row? ie. given a table with a single field named "myField" with the following values I want a SELECT statement that selects the rows "WHERE myField='1' and myField = '2' ": 5 6 1
1
2298
by: sumGirl | last post by:
Hi all. We have a mix of informix and mssql server and I want to know if something we do in informix has an analogous feature in MSSQL. We can define a "row type" in informix, like so: create row type name_1(fname char(20),lname char(20)); The when we create any table that includes a first and last name, we do so using this row type like so: create table sometable(name name_1, some column,...etc)
388
21669
by: maniac | last post by:
Hey guys, I'm new here, just a simple question. I'm learning to Program in C, and I was recommended a book called, "Mastering C Pointers", just asking if any of you have read it, and if it's worth the $25USD. I'm just looking for a book on Pointers, because from what I've read it's one of the toughest topics to understand. thanks in advanced.
12
4121
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport) {
2
1876
by: Ken Schutte | last post by:
Lets say I want an integer class that lets you attach arbitrary attributes. I can simply do: class foo(int): pass x = foo(5) x.text = "okay" print x, x.text # prints "5 okay" So, that's good. But, how can I change the value of x from 5 to
24
2062
by: carnold | last post by:
Hello, I'm a developer coming from C++ and Java ... I've going thru "Effective C#" (which highly recommend for people coming from other languages wanting to learn C#), and it states that "value types" are always created on the stack, but then showed the "creation" of one w/ operator new. I guess it makes sense, but is it true that: MyValueType t;
25
20549
by: tekctrl | last post by:
Anyone: I have a simple MSAccess DB which was created from an old ASCII flatfile. It works fine except for something that just started happening. I'll enter info in a record, save the record, and try to move to another record and get an Access error "Record is too large". The record is only half filled, with many empty fields. If I remove the added data or delete some older data, then it saves ok and works fine again. Whenever I'm...
0
8483
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8402
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8676
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.