常用SQL语句
分页代码:
select top 10 * from table where id not in (select top 10 id from table ) as a
清空表数据 Id从头开始
TRUNCATE TABLE tablename
[sqlserver]获取列对应的说明/描述
SELECT d.name N'表名', a.name N'字段名', isnull(g.[value],'') AS N'字段说明' FROM syscolumns a inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name='equipmentchip' left join sys.extended_properties g on a.id=g.major_id AND a.colid = g.minor_id
更改root密码:set password for root@localhost = password('new-passwords');
//为登录账户名:密码 的账户开通%权限,允许远程访问
GRANT ALL PRIVILEGES ON *.* TO '登录账户名'@'%'IDENTIFIED BY '密码' WITH GRANT OPTION;
flush privileges;