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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:59:33+00:00 2026-06-16T03:59:33+00:00

I have a table where I need to change from null to not null.

  • 0

I have a table where I need to change from “null” to “not null”.

I have a table with following structure:

Created_By   Created_Date_Time   Modified_By    Modified_Date_Time
NULL            NULL                -1                 NULL
NULL            NULL                -1                 NULL
NULL            NULL                -1                 NULL

I need to change Modified_By from -1 to null.

I am trying with the following query but it gives me an error:

update BOM_Rules
set Modified_By = not null

Error:

Cannot insert the value NULL into column 'Modified_By', table 'dbo.BOM_Rules'; column does not allow nulls. UPDATE fails.

I am sure I am missing something important. Maybe alter table?

ALTER TABLE BOM_Rules
ALTER COLUMN Modified_By NVARCHAR(50) NOT NULL

I am using SQL2008R2.

  • 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-06-16T03:59:35+00:00Added an answer on June 16, 2026 at 3:59 am

    It sounds like the Modified_By column does not allow nulls. Try altering the column to allow nulls:

    ALTER TABLE BOM_Rules
    ALTER COLUMN Modified_By NVARCHAR(50) NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have the following table: CREATE TABLE [dbo].[CampaignCustomer]( [ID] [int] IDENTITY(1,1) NOT NULL, [CampaignID]
We have the following table: CREATE TABLE [dbo].[CampaignCustomer]( [ID] [int] IDENTITY(1,1) NOT NULL, [CampaignID]
I have three table I need to query table 1,2 and 3 and select
I have database, and in one the tables I need change the values of
I have table 'products' and I need to update 'price' field by 20% if
I have a table that I need to update where all columns are optionally
I have table to test score data that I need to pivot and I
I have a table and I need to count all unique users on it.
I have table: id name type where type is 1 or 2 I need
I have table which contains double values stored in mysql database ...I need to

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.