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

Sql Server根据记录集批量更新数据库

update   t1   set   t1.value=t2.value   from   t2   where   t1.id=t2.id
 
update jbsite_class  set topicnum = count
from (select t2.classid,count from (
select distinct classid,count(*) as count
from jbsite_product
group by classid) t2
inner join  jbsite_product on jbsite_product.id = t2.classid
) b where jbsite_class.id=b.classid


相关文档:

SQL触发器

一个简单的小实例就明白~!
 user表
在这张表中建立触发器  
 Create   trigger   tiggername  
 on   user     
 for   delete     
 as   
 begin ......

Sql 查询当天、本周、本月记录

Sql代码:Powered by chenjiazi
--查询当天:   
select * from info where DateDiff(dd,datetime,getdate())=0   
  
--查询24小时内的:   
select * from info where DateDiff(hh,datetime,getDate())<=24   
  
--info为表名,datetime为数 ......

常用 SQL 语句大全

本文总结了开发工作中常用的SQL语句,供大家参考……
--语 句 功 能
--数据操作
SELECT --从数据库表中检索数据行和列
INSERT --向数据库表添加新数据行
DELETE --从数据库表中删除数据行
UPDATE --更新数据库表中的数据
--数据定义
CREATE TABLE --创建一个数据库表
DROP TABLE --从数据库中删除表
A ......

SQL Server bcp

D:\projects\openi\misc\xxxx_data_20090828>bcp [xxxxolap].[dbo].[wdb_cxbz]  in wdb_xxx.txt      -c -T
SQLState = 37000, NativeError = 4060
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Cannot open database "xxxolap" requested by the login. The login failed.
S ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号