通行证 | 帐号: 密码: 注册 | 登录
网站地图
范文同学网


自动化 模具 机械 电子 通信 动画 英语范文 工程管理 金融范文 旅游管理 工业工程 生物工程 给排水范文 西门子PLC 历史学 三菱PLC
单片机 财务 会计 法律 行政 物理 物流范文 电子商务 制药工程 包装工程 土木工程 材料科学 汉语言范文 欧姆龙PLC 电压表 松下PLC
计算机 化工 数电 工商 食品 德语 国贸范文 人力资源 教育管理 交通工程 市场营销 印刷工程 机电一体化 数控范文 变电站 文化产业

  • 网站首页|
  • 文档范文|
  • 人工降重|
  • 职称文章发表|
  • 合作期刊|
  • 范文下载|
  • 计算机范文|
  • 外文翻译|
  • 免费范文|
  • 原创范文|
  • 开题报告

联系方式

当前位置:范文同学网 -> 免费范文 -> 计算机范文 -> 五种提高SQL性能的方法(一)
计算机文章范文| ASP设计| Delphi| VB设计| JSP设计| ASP.NET| VB.NET| java设计| VC| pb| VS| dreamweaver| c#.net| vf| VC++| 计算机文档范文| 范文下载| 自动化范文
·电气自动化原创文章范文 ·学前教育专业原创文章范文 ·国际经济贸易原创文章范文 ·药学专业原创文章范文 ·英语专业原创文章范文 ·公共事业管理原创文章范文
·金融专业原创文章范文 ·广播电视编导原创文章范文 ·电子商务专业原创文章范文 ·法律专业原创文章范文 ·工商管理原创文章范文 ·汉语言文学原创文章范文
·人力资源管理原创文章范文 ·摄影专业原创文章范文 ·心理学专业原创文章范文 ·教育管理原创文章范文 ·市场营销原创文章范文 ·计算机专业原创文章范文
·物流管理专业原创文章范文 ·小学教育专业原创文章范文 ·行政管理专业原创文章范文 ·土木工程管理原创文章范文 ·财务会计专业原创文章范文 ·信息管理信息系统原创范文
·新闻学专业原创文章范文 ·眼视光技术原创文章范文 ·播音与主持原创文章范文 ·广告学专业原创文章范文 ·表演专业原创文章范文 ·动画专业原创文章范文
·视觉传达设计原创文章范文 ·数控技术专业原创文章范文 ·录音艺术原创文章范文 ·光机电应用技术原创范文 ·机电一体化原创文章范文 ·印刷技术专业原创文章范文
·动漫设计与制作原创范文 ·软件技术专业原创文章范文 ·书法学专业原创文章范文 ·应用电子技术原创文章范文 ·电子信息工程技术原创范文 ·机械专业原创文章范文
·酒店管理专业原创文章范文 ·旅游管理专业原创文章范文 ·文化产业管理专业原创范文 ·体育教育专业原创文章范文 ·通信工程专业原创文章范文 ·护理专业原创文章范文

原创文档范文 → 计算机专业原创文档范文 软件技术专业原创文档范文  现成文档范文 → 计算机文档范文

五种提高SQL性能的方法(一)

本文ID:LW6108 ¥
译文 Five Ways to Rev up Your SQL Performance Sometimes all it takes is a little tweak here or there to make your application run much faster. Ah, but the key is figuring out how to tweak it! Sooner or later you'll face a situation where a SQL query in your application isn't responding the way yo..

译文
Five Ways to Rev up Your SQL Performance
 Sometimes all it takes is a little tweak here or there to make your application run much faster. Ah, but the key is figuring out how to tweak it! Sooner or later you'll face a situation where a SQL query in your application isn't responding the way you intended. Either it doesn't return the data you want or it takes entirely too long to be reasonable. If it slows down a report or your enterprise application, users won't be pleased if they have to wait inordinate amounts of time. And just like your parents didn't want to hear why you were coming in past curfew, users don't want to hear why your query is taking so long. ("Sorry, Mom, I used too many LEFT JOINs.") Users want applications to respond quickly and their reports to return analytical data in a flash. I myself get impatient when I surf the Web and a page takes more than ten seconds to load (OK, more like five seconds).
 To resolve these issues, it is important to get to the root of the problem. So where do you start? The root cause is usually in the database design and the queries that access it. In this month's column I'll demonstrate four techniques that can be used to either improve your SQL Server™-based application's performance or improve its scalability. I'll examine the use of LEFT JOINs, CROSS JOINs, and retrieving an IDENTITY value. Keep in mind that there is no magic solution. Tuning your database and its queries takes time, analysis, and a lot of testing. While the techniques here are proven, some may work better than others in your application.
 Returning an IDENTITY From an INSERT
 I figured I would start with something I get a lot of questions about: how to retrieve an IDENTITY value after performing a SQL INSERT. Often, the problem is not how to write the query to retrieve the value, but rather where and when to do it. In SQL Server, the statement to retrieve the IDENTITY value created by the most recent SQL statement run on the active database connection is as follows:
 SELECT @@IDENTITY
 While this SQL is far from daunting, it is important to keep in mind that if the most recent SQL statement was not an INSERT or you run this SQL against a different connection than the INSERT SQL, you will not get back the value you expect. You must run this code to retrieve the IDENTITY immediately following the INSERT SQL and on the same connection, like this:
 INSERT INTO Products (ProductName) VALUES ('Chalk')
 SELECT @@IDENTITY
 Running these queries on a single connection against the Northwind database will return to you the IDENTITY value for the new product called Chalk. So in your Visual Basic® application using ADO, you could run the following statement:
 Set oRs = oCn.Execute("SET NOCOUNT ON;INSERT INTO Products _
 (ProductName) VALUES ('Chalk');SELECT @@IDENTITY")
 lProductID = oRs(0)
 This code tells SQL Server not to return a row count for the query, then executes the INSERT statement and returns the IDENTITY value just created for the new row. The SET NOCOUNT ON statement means the Recordset that is returned has one row and one column that contains the new IDENTITY value. Without this statement, an empty Recordset is returned (because the INSERT statement returns no data) and then a second Recordset is returned, which contains the IDENTITY value. This can be confusing, especially since you never intended the INSERT to return a Recordset. This situation occurs because SQL Server sees the row count (that is, one row affecte

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 1/7/7

五种提高SQL性能的方法(一)相关范文
网络测量 性能评价 性能指标
关于学习SQL Server数据库的体会
百度和Google搜索引擎的性能比较与分析
delphi+sql办公自动化系统(+开题报告..
delphi+服务信息管理系统+sql[开题报告..
delphi气象服务业务系统+sql[开题报告..
delphi+sql物资管理系统[开题报告+范..
ASP同学录设计asp+sql
ASP.NET;SQL酒店管理系统开发
asp人力资源管理系统ASP+SQL+范文+源程..
上一篇:ASP动态网站建设范文 下一篇:基于Web的网上评教系统
点击查看关于 提高 SQL 性能 方法 的相关范文题目 【返回顶部】
精彩推荐
电气工程自动化原创范文  电子商务原创文章范文
人力资源专业原创文章范文 土木工程原创文章范文
工商管理专业原创范文    药学专业原创范文
汉语言文学专业原创范文  会计专业原创文章范文
计算机技术原创文章范文  金融学原创文章范文
法学专业原创文章范文   市场营销专业原创范文
信息管理专业原创文章范文 学前教育专业原创范文
公共事业管理专业原创范文 英语专业原创范文
教育管理专业原创范文   行政管理专业原创范文
热门范文
学生管理系统文档范文
免费图书管理系统
计算机局域网组建与互连文档设计范文
校园网组网方案设计
学生学籍管理信息系统文档范文
商品销售管理系统范文
超市管理系统+范文
网上书店系统的设计与实现
个人网站设计之上网导航设计
计算机应用基础学习心得

关于我们 | 联系方式 | 范文说明 | 网站地图 | 免费获取 | 钻石会员 | 硕士文章范文


范文同学网提供文档范文,原创文章范文,网站永久域名www.lunwentongxue.com ,lunwentongxue-范文同学网拼音首字母组合

本站部分文章来自网友投稿上传,如发现侵犯了您的版权,请联系指出,本站及时确认并删除  E-mail: 17304545@qq.com

Copyright@ 2009-2024 范文同学网 版权所有