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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:03:12+00:00 2026-05-17T23:03:12+00:00

I right click on my table in ssms 2008 and select Script Table as

  • 0

I right click on my table in ssms 2008 and select Script Table as / Drop and Create Table to new window and I try to run the script but get an error:

Could not drop table because it is referenced by a foreign key constraint

What was the point of the Drop and Create generate script then?

Thanks,

rod.

  • 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-17T23:03:13+00:00Added an answer on May 17, 2026 at 11:03 pm

    The point of the Drop and Create generate script is exactly what you’d think – it gives you an easy way to script out dropping and re-creating a table. However you can’t drop a table if other tables reference it via foreign key constraints, which is why you’re getting the error message.

    If you’re just trying to add a column, you can right-click the table in Enterprise Manager and click Modify and just add the column in design view. There’s no need to drop the table just to add a column. (And it’s especially an awful approach if the table has data in it.)

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

Sidebar

Related Questions

SSMS allows you to right-click a table and Script Table as->Select to. I thought
I know you can create a script to replicate a table using: right click
In Microsoft SQL 2008 Enterprise manager, when you right click a table to open
When I right-click a solution in VS2008 and select Check In... I am presented
I want to create a right click context menu for my textboxes to provide
I used to be able to right click Folders in my project and click
Is there a way to detect a right click followed by paste with JavaScript
If I use the following code I lose the ability to right click on
In the library, right-click on a movieclip that you have written an ActionScript class
When developing in a VS2005+ with C# project and I right click on a

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.