Database

SQL2005 自动备份数据库且保存为 时间.BAK

首先开启Agent服务

找到管理的维护计划

输入计划名称 在按确定

选择相应

此时一定要保持 c+s

DECLARE @strPath NVARCHAR(200)
set @strPath = convert(NVARCHAR(19),getdate(),120)
set @strPath = REPLACE(@strPath, ':' , '-')
set @strPath = 'F:\' + @strPath + '.bak'
BACKUP DATABASE [AhlanStock] TO DISK = @strPath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT

SQL Server , MySQL 随机查询示例

SQL Server:
Select TOP 10 * From oa_xmgl where create_by = 'admin' Order By NewID() 

MySql:
Select * From oa_xmgl Order By Rand() Limit 10