Modify the field type and name in SQLServer -- The following is the complete SQL Execution statement ifexists (select * fromsyscolumnswhere table name) and) -- determine whether this field exists beginALTERTABLE indicates the name of the ALTERCOLUMN field VARCHAR (64); -- change the type endGOifexis
Modify the field type and name in SQL Server-The following is the complete SQL Execution statement if exists (select * from syscolumns where id = object_id ('table name') and) -- determine whether the field has begin alter table, indicating that the alter column field name is VARCHAR (64); -- change the type of end GO if exis
Modify the field type and name in SQL Server
-- The following are complete SQL Execution statements:
If exists (select * from syscolumns where id = object_id ('table name') and) -- determine whether the field exists
Begin
Alter table indicates the alter column field name VARCHAR (64); -- change the type
End
GO
If exists (select * from syscolumns where id = object_id ('table name') and) -- determine whether the field exists
Begin
EXEC sp_rename 'indicates. Old Field name', 'new field name', 'column '; -- change field name sp_rename to data storage procedure