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 575765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:58:32+00:00 2026-05-13T13:58:32+00:00

I have already asked a question about this, but the problems keeps on hitting

  • 0

I have already asked a question about this, but the problems keeps on hitting me 😉

I have two tables that are identical. I want to add a xml column. In the first table this is no problem, but in the second table I get the sqlException (title). However, apart from the data in it, they are the same. So, can I get the sqlException because of data in the table?

I have also tried to store the field off page with

EXEC sp_tableoption 'dbo.PackageSessionNodesFinished', 
  'large value types out of row', 1

but without any succes. The same SqlException keeps coming.

First table: PackageSessionNodes

CREATE TABLE [dbo].[PackageSessionNodes](
    [PackageSessionNodeId] [int] IDENTITY(1,1) NOT NULL,
    [PackageSessionId] [int] NOT NULL,
    [TreeNodeId] [int] NOT NULL,
    [Duration] [int] NULL,
    [Score] [float] NOT NULL,
    [ScoreMax] [float] NOT NULL,
    [Interactions] [xml] NOT NULL,
    [BrainTeaser] [bit] NULL,
    [DateCreated] [datetime] NULL,
    [CompletionStatus] [int] NOT NULL,
    [ReducedScore] [float] NOT NULL,
    [ReducedScoreMax] [float] NOT NULL,
    [ContentInteractions] [xml] NOT NULL,
 CONSTRAINT [PK_PackageSessionNodes] PRIMARY KEY CLUSTERED 
(
    [PackageSessionNodeId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

Second table: PackageSessionNodesFinished

CREATE TABLE [dbo].[PackageSessionNodesFinished](
    [PackageSessionNodeFinishedId] [int] IDENTITY(1,1) NOT NULL,
    [PackageSessionId] [int] NOT NULL,
    [TreeNodeId] [int] NOT NULL,
    [Duration] [int] NULL,
    [Score] [float] NOT NULL,
    [ScoreMax] [float] NOT NULL,
    [Interactions] [xml] NOT NULL,
    [BrainTeaser] [bit] NULL,
    [DateCreated] [datetime] NULL,
    [CompletionStatus] [int] NOT NULL,
    [ReducedScore] [float] NOT NULL,
    [ReducedScoreMax] [float] NOT NULL,
    [ContentInteractions] [xml] NULL,
 CONSTRAINT [PK_PackageSessionNodesFinished] PRIMARY KEY CLUSTERED 
(
    [PackageSessionNodeFinishedId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, 
ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

First script I tried to run (First two ALTER TABLE work fine, the third crashes on SqlException)

ALTER TABLE dbo.PackageSessionNodes ADD
    ContentInteractions xml NOT NULL CONSTRAINT 
    DF_PackageSessionNodes_ContentInteractions 
    DEFAULT (('<contentinteractions/>'));

ALTER TABLE dbo.PackageSessionNodes
    DROP CONSTRAINT DF_PackageSessionNodes_ContentInteractions

ALTER TABLE dbo.PackageSessionNodesFinished ADD
    ContentInteractions xml NOT NULL CONSTRAINT 
    DF_PackageSessionNodesFinished_ContentInteractions 
    DEFAULT (('<contentinteractions/>'));

ALTER TABLE dbo.PackageSessionNodesFinished
    DROP CONSTRAINT DF_PackageSessionNodesFinished_ContentInteractions

Second script I tried to run with the same result as previous script:

EXEC sp_tableoption 'dbo.PackageSessionNodes', 
    'large value types out of row', 1

ALTER TABLE dbo.PackageSessionNodes ADD
    ContentInteractions xml NOT NULL CONSTRAINT
    DF_PackageSessionNodes_ContentInteractions 
    DEFAULT (('<contentinteractions/>'));

ALTER TABLE dbo.PackageSessionNodes
    DROP CONSTRAINT DF_PackageSessionNodes_ContentInteractions

EXEC sp_tableoption 'dbo.PackageSessionNodesFinished', 
    'large value types out of row', 1

ALTER TABLE dbo.PackageSessionNodesFinished ADD
    ContentInteractions xml NOT NULL CONSTRAINT 
    DF_PackageSessionNodesFinished_ContentInteractions 
    DEFAULT (('<contentinteractions/>'));

ALTER TABLE dbo.PackageSessionNodesFinished
    DROP CONSTRAINT DF_PackageSessionNodesFinished_ContentInteractions

Now, In PackageSessionNodes there are 234 records, in PackageSessionNodesFinished there are 4256946 records.

Really would appreciate some help here as I’m stuck.

  • 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-05-13T13:58:32+00:00Added an answer on May 13, 2026 at 1:58 pm

    Try emptying your table first, make your change, then put the data back in again. It sounds like there is a row which is storing its existing data in the row, and adding the new column is just over its limit. If you take the data out, make the change, and then put it back again, it ought to store the xml out-of-row instead.

    Unfortunately, it won’t move data out of a row when you make this type if change. It’s a very rare situation, you’re unlucky.

    Edit: also, you could try rebuilding your clustered index after you have set the table option, so that all the XML will be forced out of row. You could also do some maths and some calculating row lengths, to work out which row(s) are causing the problem. Then you could move that data temporarily.

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

Sidebar

Related Questions

Question: I have a question that is apparently not answered by this already-asked Bash
I have already posted something similar here but I would like to ask the
I have already googled for this I have a Table with following structure in
The basics have already been answered here . But is there a pre-built PHP
I know I have already answered a similar question ( Running Batch File in
OK, I know there have already been questions about getting started with TDD ..
I have already tried PreRenderComplete and unload is too late
I have a repository which I have already cloned from Subversion. I've been doing
In .NET I have already tried the configuration below successfully: <system.net> <connectionManagement> <add address=*
I believe several of us have already worked on a project where not only

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.