易截截图软件、单文件、免安装、纯绿色、仅160KB

MSSQL中计算两个日期之间相隔 xx天xx小时xx分xx秒

 DECLARE @dt1 AS datetime, @dt2 AS datetime;
SELECT @dt1 = '2008-8-4 9:36:41', @dt2 = '2008-8-2 9:33:39';
DECLARE @Days AS int, @Hours AS int, @Minutes AS int, @Seconds AS int;
SET @Seconds = DATEDIFF( second, @dt2, @dt1);
SET @Days = @Seconds / (24 * 60 * 60)
SET @Seconds = @Seconds - @Days * 24 * 60 * 60
SET @Hours = @Seconds / (60 * 60);
SET @Seconds = @Seconds - @Hours * 60 * 60
SET @Minutes = @Seconds / 60;
SET @Seconds = @Seconds - @Minutes * 60;
SELECT CONVERT(varchar(10), @Days ) + '天'
          + CONVERT(varchar(10), @Hours ) + '小时'
          + CONVERT(varchar(10), @Minutes ) + '分'
          + CONVERT(varchar(10), @Seconds ) + '秒';


相关文档:

mssql 中将汉字转换为拼音首字母方法


1.
--将汉字转换为拼音首字母
CREATE   function   GetAllPY(@str   nvarchar(4000))
returns   nvarchar(4000)
--WITH   ENCRYPTION
as
begin
declare   @intLen int
declare   @strRet nvarchar(4000)
declare   @temp   nvarchar(100)
set   @intLen &nb ......

How is MSSQL using memory?


How is MSSQL using memory?
http://www.sqlhacks.com/Administration/Memory-Usage
Memory is one the most important factor affecting MSSQL performance.
As an administrator, you should be monitoring the memory
regularly. When Microsoft SQL Server runs out of memory, it will use
virtual memory: ie: ......

用作业实现自动备份MSSQL数据库到远程服务器

--此代码实现SQL数据库远程备份,放到作业里面执行可以自动备份数据库、自动删除@keepNDays天前备份。
--此代码将本地所有的用户数据库备份到共享目录“\\backupServerIp\ShareName\数据库备份”下。
--并删除天前的备份文件。要备份成功必须能够对共享目录有操作权限!

sp_configure 'xp_cmdshell',1 ......

php 5.3 连接mssql数据库

最近有个小东西要查看mssql数据库是用php实现的,以前我用php5.2时感觉挺简单的所以想php5.3也应该很简单的
为什么要用php5.3呢因为我想用sqlite3.0的啊,因为php5.2的不支持sqlite3.0的啊,所以我特意去下了5.3了下载回来了才发现5.3里没有mssql的dll扩展了,郁闷啊,不管这么多先用起那sqlite3.0再说了
sqlite3.0的部分 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号