سؤال

Could not rename a column in a Sybase 15 table. I am getting the below error. Please help. What am I missing?

Incorrect syntax near 'NAME1'.


CREATE TABLE TEST1 (NAME1 VARCHAR(20) NULL, NAME2 VARCHAR(20) NULL)
GO
ALTER TABLE TEST1 RENAME NAME1 TO FIRST_NAME
GO

Referring http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc38151.1270/html/iqref/BABCGFHG.htm

هل كانت مفيدة؟

المحلول

You have tagged Sybase ASE but your link points to Sybase IQ

Here is how you do in ASE

sp_rename 'TEST1.NAME1', 'FIRST_NAME'
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top