且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

向现有表中添加一列并在 MS SQL Server 上对其进行唯一编号

更新时间:2023-12-01 08:42:58

这将取决于数据库,但对于 SQL Server,这可以通过以下方式实现:

This will depend on the database but for SQL Server, this could be achieved as follows:

alter table Example
add NewColumn int identity(1,1)