2011年6月20日

计算SQL语句执行时间的方法

摘要: use northwind declare @date1 datetime declare @date2 datetime select @date1=getdate() --测试语句 select * from employees select @date2=getdate() select datediff(millisecond, @date1, @date2) --结果是毫秒数本篇文章来源于 dotnet开源社区 原文链接:http://www.openaspx.com/article/201106/20/20110620054654.htm 阅读全文

posted @ 2011-06-20 17:48 IT凡人 阅读(227) 评论(0) 推荐(0)

SQL备份还原

摘要: SQL备份 ======================================================================本篇文章来源于 dotnet开源社区 原文链接:http://www.openaspx.com/article/201106/20/20110620054455.htm---------------------------------------------------------------------- 1、SQL数据库恢复模型 -------------------------------------------------------- 阅读全文

posted @ 2011-06-20 17:47 IT凡人 阅读(192) 评论(0) 推荐(1)

Update 两个表之间数据更新

摘要: 一、当用一个表中的数据来更新另一个表中的数据,T-SQL提供多种写法(下面列出了二种),但建议用第一种写法,虽然传统,但结构清晰。并且要注意,当用一个表中的数据来更新另一个表中的数据时,二个表一定要有关联!1.update t1 set t1.c2 = t2.c2 from t2 where t1.c1 = t2.c12.Update t1 set t1.c2 = t2.c2 from t1 inner join t2 on t1.c1 = t2.c1二、FROM 子句中指定的表的别名不能作为 SET column_name 子句中被修改字段的限定符使用。 例如,下面的内容无效:UPDATE 阅读全文

posted @ 2011-06-20 17:44 IT凡人 阅读(468) 评论(0) 推荐(0)

导航