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

  • Home
  • SEARCH
  • 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 6328821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:31:50+00:00 2026-05-24T17:31:50+00:00

I am trying to modify the size of a column in a table, however

  • 0

I am trying to modify the size of a column in a table, however that column is a primary key column and is used in other table ( which would need to have its size modified too)

I have a table called table1 with a column named column1 as primary key
I also have table2,table3 and table4 that has table2column1, table3column1 and table4column1 respectively.
table2column1,table3column1 and table4column1 are foreign keys ( reference column1 from table1) and they are also used as a composite primary key in their respective table.

I tried doing this to alter the size of the column

ALTER TABLE  UtilisateurNotes ALTER COLUMN IDNotes nvarchar(250)

It did not work.

This is the error message : Cannot alter a column that is part of a key or an index.

Anyone has an idea what I should do? thank you Gibit

  • 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-24T17:31:50+00:00Added an answer on May 24, 2026 at 5:31 pm

    You have to drop the foreign keys and primary key index in order to modify the column and then rebuild them after.

    If you’re in SQL Server Management Studio and you use the Object Explorer then you can right click on the specific Primary Key or Foreign Key specified in the error message and use Script as > CREATE AND DROP to help you generate the necessary scripts for the update.

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

Sidebar

Related Questions

I have an issue i am trying to modify a form's tab order which
Hi I'm trying to modify a web page so that it loads faster. Since
I am trying to modify the controls of a Panel, have it update, then
I've been trying to modify the AuditTrail code so that it does not copy
I'm trying to modify the Django Admin interface. I need a custom type of
I'm trying to modify the text of a Label component that I already placed
I am trying to modify the imageDenosing class in CUDA SDK, I need to
Here is what I have <img src=http://some.site.com/v/b/image-name/_thumb_100x100.jpg> I'm trying to modify the src by
I'm trying to modify an object on a click. Here's what I have. <form>
I'm trying to modify this plugin so that is counts characters rather than words.

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.