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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:48:38+00:00 2026-05-13T14:48:38+00:00

I’ve have this strange problem when adding a column to an existing table. The

  • 0

I’ve have this strange problem when adding a column to an existing table.

The existing table looks like :

CREATE TABLE [BinaryAssets].[BinaryAssets](
 [BinaryAssetId] [int] IDENTITY(1,1) NOT NULL,
 [BinaryAssetStructureId] [int] NOT NULL,
 [Name] [nvarchar](max) NOT NULL,
 [Created_By] [int] NOT NULL,
 [Created_On] [bigint] NOT NULL,
 [Modified_By] [int] NOT NULL,
 [Modified_On] [bigint] NOT NULL,
 [Active] [bit] NOT NULL,
 CONSTRAINT [PK_BinaryAsset] PRIMARY KEY NONCLUSTERED 
(
 [BinaryAssetId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF,
   ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

Now, the sql I’m trying to execute looks like :

ALTER TABLE BinaryAssets.BinaryAssets ADD
 [Version] INT NOT NULL CONSTRAINT DF_BinaryAssets_Version DEFAULT 1

ALTER TABLE BinaryAssets.BinaryAssets
 DROP CONSTRAINT DF_BinaryAssets_Version

When I’m trying to execute I get a sqlexception (see Title).

Now, I don’t think my table exceeds 8060, so what’s the problem here. Strange thing is that when I change for instance the Name from nvarchar(max) to nvarchar(100), then execute my new sql and then change back the 100 to MAX, it does work… logic seems far away here.

Can anybody tell me what I’m doing wrong here?

  • 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-13T14:48:39+00:00Added an answer on May 13, 2026 at 2:48 pm

    The biggest size you can give an nvarchar field is of MAX, wich is 4000 chars (2 bytes Unicode chars).

    In SQL Server 2000 and SQL Server 7, a
    row cannot exceed 8000 bytes in size.
    This means that a VARBINARY column can
    only store 8000 bytes (assuming it is
    the only column in a table), a VARCHAR
    column can store up to 8000 characters
    and an NVARCHAR column can store up to
    4000 characters (2 bytes per unicode
    character). This limitation stems from
    the 8 KB internal page size SQL Server
    uses to save data to disk.

    If you need to store a longer body of text, you should be using either text or ntext, which can hold as much text as your system has hard drive space.

    You seem to be trying to create a row with a size larger than the possible size, which is not a valid operation.

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

Sidebar

Ask A Question

Stats

  • Questions 396k
  • Answers 396k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer ActiveRecord::Relation is a fairly weak wrapper around Base#find_by_sql, so :include… May 15, 2026 at 2:57 am
  • Editorial Team
    Editorial Team added an answer see this page for a list, but be warned, some… May 15, 2026 at 2:56 am
  • Editorial Team
    Editorial Team added an answer $.get(url, function(response){ var title = (/<title>(.*?)<\/title>/m).exec(response); if (!title || !title[1]){… May 15, 2026 at 2:56 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.