惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
腾讯CDC
D
Docker
G
Google Developers Blog
D
DataBreaches.Net
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
The Cloudflare Blog
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Stack Overflow Blog
Stack Overflow Blog
大猫的无限游戏
大猫的无限游戏
量子位
美团技术团队
aimingoo的专栏
aimingoo的专栏
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Engineering at Meta
Engineering at Meta
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - zhengfeng

GridView 72般绝技 链接打开固定大小的新窗口 iframe传值和自适应高度 页面传参 小技巧 js表单验证控制代码大全 - zhengfeng - 博客园 自己写的递归方法复制文件夹里面的内容(从源文件(里面可以有多个层次的子文件夹)到一个文件夹) 递归写的复制文件夹及其下的内容(原样复制) JS取得URL中的参数值 自己写的将文件从多个文件合并到一个文件夹的小方法 使用 Hashtable 集合(一) MessageBox.Show用法 System.IO.File类和System.IO.FileInfo类 Math.floor和Math.ceil函数 Document对象 javascript小技巧 JavaScript的学习 正则表达式的学习: DataList分页
工作小结:
zhengfeng · 2007-06-26 · via 博客园 - zhengfeng

1.EXCEL中的函数:
=CONCATENATE("INSERT INTO  [SnatchDB].[dbo].[Snatch_Mission]([F_ID],[MissionName],[BeginURL],[NewsLabel]) VALUES(",Y2,",'",D2,"','",E2,"','",C2,"'",")")
2.SQL2005中清空日志的方法:
第一步: 先备份整个数据库以备不测
第二步: 备份结束后,在Query Analyzer中执行如下的语句: exec sp_detach_db yourDBName,true --卸除这个DB在MSSQL中的注册信息
第三步: 到日志的物理文件所在的目录中去删除该日志文件或者将该日志文件移出该目录
第四步: 在Query Analyzer中执行如下的语句: exec sp_attach_single_file_db yourDBName,'d:\mssql7\data\yourDBName_data.mdf' -- 以单文件的方式注册该DB,如果成功则MSSQL将自动为这个DB生成一个500K的日志文件
3.datalist奇偶行替换显示颜色,
       if (e.Row.RowType == DataControlRowType.DataRow)//判定当前的行是否属于datarow类型的行
         {
             //当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色
             e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#d3d3d3',this.style.fontWeight='';");
             //当鼠标离开的时候 将背景颜色还原的以前的颜色
             e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
         }
         //单击行改变行背景颜色
         if (e.Row.RowType == DataControlRowType.DataRow)
         {
             e.Row.Attributes.Add("onclick", "this.style.backgroundColor='Burlywood'; this.style.color='buttontext';this.style.cursor='default';");
         }
4.把A表中的categoryID改换为B表中的newcategoryID:
    update A set A.categoryID=B.newcategoryID from A join B on A.categoryid=B.oldCategoryid
5.有A,B两表,A表中字段TYPE(产品型号),B表中有字段P_NAME(产品名称,名称中包含产品型号),现将两个字段like查询,找出P_NAME中包含的型号,把A表中相对应的ID写入B表中的P_ID中:
update B
set P_ID=A.ID
from B,A
where charindex(A.TYPE,B.P_NAME)>0      ( 用charindex函数判断type是否在p_name中where charindex(a.type1,b.p_name)>0)

update b set pid=(select id from a where b.p_name like '%'+a.type+'%')

6.

两个表相联接查询,A表和B表,A表中有categoryID,B表中有oldcategoryID,现在的做法是从A表中找到其categoryID与B表中oldcategoryID不一样的数据!并按A表中的categoryID分组,并去除重复的categoryID.也就是每个categoryID的分类只显示一条:
SELECT categoryID FROM A
WHERE NOT EXISTS(SELECT 1 FROM B WHERE A.categoryID=B.oldcategoryID)
GROUP BY categoryID