【发布时间】:2016-06-29 04:13:09
【问题描述】:
我在 sybase 中遇到了问题。
通过在stackoverflow中搜索,我找到了this链接。
但我发现在 sybase 中不正确,这给了我一个语法错误警告。 有没有其他方法可以改变sybase中的主键?
【问题讨论】:
我在 sybase 中遇到了问题。
通过在stackoverflow中搜索,我找到了this链接。
但我发现在 sybase 中不正确,这给了我一个语法错误警告。 有没有其他方法可以改变sybase中的主键?
【问题讨论】:
我们可以使用 sp_dropkey 删除键,使用 sp_primarykey 添加主键。
sp_dropkey primary, MyTable
sp_primarykey MyTable, col1, col2,..,col8
【讨论】:
create table S87EntityFolderMap ( cty_cde CountryCode not null , entity Entity not null , folder Folder not null , PRIMARY KEY CLUSTERED ( cty_cde, entity,folder ) on 'default' )
1- 使用:
sp_helpconstraint S87EntityFolderMap
获取你的主键系统生成的名字
2- 然后使用 alter table 删除它:
alter table S87EntityFolderMap drop constraint name_from_first_step
【讨论】: