在特定位置的 SQL Server 上添加列? [英] Add Column on SQL Server on Specific Place?

查看:32
本文介绍了在特定位置的 SQL Server 上添加列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法在 SQL Server 表创建后将列添加到特定位置??

I would like to know if there's a way to add a column to an SQL Server table after it's created and in a specific position??

谢谢.

推荐答案

您可以在 Management-Studio 中做到这一点.您可以通过在保存更改之前生成 SQL 脚本来检查完成此操作的方式.基本上它是通过以下方式实现的:

You can do that in Management-Studio. You can examine the way this is accomplished by generating the SQL-script BEFORE saving the change. Basically it's achieved by:

  • 删除所有外键
  • 使用添加的列创建新表
  • 将旧表中的所有数据复制到新表中
  • 删除旧桌子
  • 将新表重命名为旧名称
  • 重新创建所有外键

这篇关于在特定位置的 SQL Server 上添加列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆