gpt4 book ai didi

sql - 更改表以更改列名错误

转载 作者:行者123 更新时间:2023-12-04 21:20:21 25 4
gpt4 key购买 nike

在这里,我尝试更改表以更改列名,但发生错误。

Alter table [dbo].[Users] 
CHANGE
username UserName varchar(50),
password PassWord varchar(50),
state State int,
name Name varchar(50),
license License varchar(50),
lansno LansNo varchar(50) ,
curcuit_no CurcuitNo varchar(50) ,
communism Communism varchar(100) ,
Olduid OldUid int ,
Is_hunter Is_Hunter bit ,
free_text [FreeText] text ,
country Country varchar(50) ,
curcuit Curcuit varchar(50) ,
license_territory LicenseTerritory [varchar](50) ,
forest Forest varchar(50) ,
association Association varchar(50),
hunt_ar Hunt_Ar varchar(50) ,
area Area varchar(50) ,
contract Contract varchar(50) ,
radio_frequency RadioFrequency varchar(50)
)

发生此错误:

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near 'CHANGE'.



所以..我在这里我尝试改变表更改旧列名新列名数据类型..但在这里我收到错误

最佳答案

尝试

EXEC sp_RENAME 'Users.username', 'UserName', 'Column'
...

关于sql - 更改表以更改列名错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10730963/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com