alter table test1 alter column ide int identity(1,1) not null
这样写为什么不对?应该怎么写,我的目的是把一个varchar列改为int并且自增
这样写为什么不对?应该怎么写,我的目的是把一个varchar列改为int并且自增
解决方案 »
- 命令成功了,但不显示结果,是为什么,关于SetWindowText的用法?
- 请问怎么屏蔽系统功能键,比如Alt+Tab, Ctrl+Esc.
- 下周的昨天的昨天是男友的生日 ,祝其生日快乐,想对他说:谢谢一年来的关心和帮助,请继续将此精神发扬广大~~~~~~
- 如何使用DateTimePicker,实现与数据库中日期的关联?
- 如何将Excel中的数据导入到SQL中???
- 数据源?????
- 求教:这几个字节是什么数据类型啊?谢谢
- 求一非递归算法!非递归!
- 救我!可能有人用我的帐号登陆了,我想知道他运行了什么程序,绝对给分!!
- 如何得到任意控件的MouseEnter和MouseLeave消息?
- 50分寻求一条UPDATE语句,先祝大家圣诞快乐,拜个早年,不会又是没人来回答我的问题吧。
- 怎样对一个DOS格式的文本文件进行操作?
ALTER TABLE table_neme ALTER COLUMN abc varchar(100) null;
^^^^^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^
表名 字段名 字段属性
---------------
例如:
var ss:string;
begin
ss:='ALTER TABLE tab ALTER COLUMN a varchar('+Edit1.Text+')';//根据Edit1.Text中的数字可以动态修改
with ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add(ss);
ExecSQL;
end;
end;
The ROWGUIDCOL for the table.
A computed column or used in a computed column.
A replicated column.
Used in an index, unless the column is a varchar, nvarchar, or varbinary data type, the data type is not changed, and the new size is equal to or larger than the old size.
Used in statistics generated by the CREATE STATISTICS statement. First remove the statistics using the DROP STATISTICS statement. Statistics automatically generated by the query optimizer are automatically dropped by ALTER COLUMN.
Used in a PRIMARY KEY or [FOREIGN KEY] REFERENCES constraint.
Used in a CHECK or UNIQUE constraint, except that altering the length of a variable-length column used in a CHECK or UNIQUE constraint is allowed.
Associated with a default, except that changing the length, precision, or scale of a column is allowed if the data type is not changed.
Some data type changes may result in a change in the data. For example, changing an nchar or nvarchar column to char or varchar can result in the conversion of extended characters. For more information, see CAST and CONVERT. Reducing the precision and scale of a column may result in data truncation.你这种情况完全可以用drop column /add column的方式
TO:atyzy(笑闹江湖) 散分不能升级,但能促进升级。哈哈!