更改 字段的数据类型 Alter Table TB_ITM_ITEM alter column is_timing int NULL; 新增字段: alter table WeiboSmartCategorySetting add AccountLevelMaxFilter int null 更改字段长度 alter table TB_ITM_ITEM alter column input_pids nvarchar(200) 将某个int(bigint)型的字段变为自增字段 ALTER TAB
USE master CREATE LOGIN test --要创建的用户名 WITH PASSWORD = '123456', --密码 DEFAULT_DATABASE = DBTest, --指定数据库 CHECK_EXPIRATION = OFF, CHECK_POLICY = OFF go REVOKE VIEW ANY DATABASE TO [public] USE DBTest --数据库 go EXEC dbo.sp_changedbowner N'test'
找出所有字段 1 select a.name as columnname,object_name(a.id)as tablename into t from syscolumns a, sysobjects b, systypes c where a.id=b.id and a.xtype=c.xtype and b.xtype='u' and c.name in('varchar','nvarchar','char','nchar','text','ntext') and object_nam
不说明,直接看代码: --1. 创建表,添加测试数据 CREATE TABLE #test(code varchar(50), [values] varchar(10)) INSERT #test SELECT '001', 'aa' UNION ALL SELECT '001', 'bb' UNION ALL SELECT '002', 'aaa' UNION ALL SELECT '002', 'bbb' UNION ALL SELECT '002', 'ccc' ---2 查询SELECT
insert into records_resolve_bak(resolve_save_addr,resolve_time,resolve_status) select resolve_save_addr,resolve_time,resolve_statusfrom records_resolve order by resolve_time