background preloader

MSDN Blogs - MSDN Blogs

MSDN Blogs - MSDN Blogs

Calculating Running Totals By Garth Wells on 7 May 2001 | 25 Comments | Tags: SELECT Roger writes "Is there a way to retrive a field value from the previously read row in order to use it to calculate a field in the current row . . ." For example: day sales cumu_total 1 120 120 2 60 180 3 125 305 4 40 345 In order to calculte the cumulative total I need to know the previous cumulative total (cumulative total could be any other calculation). The answer to the questions is "yes", you can solve this problem with a single SELECT statement. Creating the Test Data I used the code shown below to create the base table and a few thousand rows of test data. The Three Solutions The three different solutions I tested are shown below. Solution 1: Temp Table/Cursor (NoIndex = 2 secs, Index = 2 secs) Solution 2: The "Celko" Solution (NoIndex = 25 secs, Index = 20 secs) SELECT DayCount, Sales, Sales+COALESCE((SELECT SUM(Sales) FROM Sales b WHERE b.DayCount < a.DayCount),0) AS RunningTotal FROM Sales a ORDER BY DayCount

Exchange Server 2003 Topic Last Modified: 2013-10-21 Welcome to the Microsoft Exchange Server 2003 Technical Documentation Library, your source for guidelines and information from the Microsoft Exchange Server team, including technical reference material, case studies, security guides, developer resources, and performance tuning recommendations. Updated versions of documents are periodically added to this library, ensuring that you have the most up-to-date Exchange Server 2003 documentation. The technical documentation for Exchange Server 2003 consists of the following categories: For a complete list of topics that changed, see Exchange Server Documentation Updates. After April 8, 2014, Microsoft will no longer provide security updates, offer free or paid support options, or update online content such as KB articles for Exchange Server 2003. Companies running Exchange 2003 after April 8, 2014 will be responsible for their own for support.

Microsoft SQL Server Integration Services: Foreach folder enumerator Case I want a Foreach Folder Enumerator, but the Foreach Loop component only loops through files. Solution Unfortunately this isn't supported by the standard Foreach Loop component, but there are a couple of workarounds: - Use an open source component Directory Foreach Enumerator or my own Custom Foreach Folder Enumerator - Use a Script task to accomplish this. This example uses the Script task and a Foreach Loop to enumerate through the folders. The Script tasks generates a list of Directories and the Foreach Loop loops through that list. 1) Control Flow Drag a Script task and a Foreach Loop container to the Control Flow like the image below. 2) Variables Create three string variables: startlocation that indicates the parent folder wherein we gonna search for subfolders. 3) Script Task Select the startlocation as a readonly variable (we only read the path inside it) and select xmldoc as a readwritevariable (an xml string will be stored in it).

Rands In Repose The Ultimate Visual Studio Tips and Tricks Blog - Site Home - MSDN Blogs This article came about as the result of a recent trip I made to a customer. I was presenting on TFS and made the, oft repeated, statement that Agile is better than Waterfall. Now I have to admit that I have never really had anyone challenge me on this assumption since most of the people I know just accept this as truth. On this particular day there were a couple of project managers in the audience and they were none too pleased about my assertion. For the rest of the hour, we went back and forth on the issue. Following are a few of exchanges to the best of my recollection: Exchange 1 Project managers: “You can’t say that agile is better than waterfall, it simply isn’t true.” Me: “I have twenty years of evidence backing up my claim and I have personally seen it work this way.” Exchange 2 Project managers: “Well, we have government regulations we deal with and you just don’t understand what we do here.” Exchange 3 Project managers: “We don’t use pure Waterfall we use a modified version.”

SQL Server Journey with SQLAuthority Andy Leonard : SSIS Expression Language and the Derived Column Transformation Introduction This post is part of a series titled An Introduction to the SSIS Expression Language. In this post, I demonstrate the SSIS Expression Language and the Derived Column Transformation. To build the demo project described in this article you will need SSIS 2005 and the AdventureWorks sample database (which can be downloaded at Add To The Demo Project If you have not already done so, create an SSIS project named ExpressionLanguageDemo. Once the project is created, open Solution Explorer and rename Package.dtsx - change the name to DerivedColumn.dtsx. Drag a Data Flow Task onto the Control Flow. Set the Data Access Mode to SQL Command and enter the following T-SQL statement into the SQL Command Text textbox: Select ContactID ,Title ,FirstName ,MiddleName ,LastName ,EmailAddressFrom Person.Contact Click OK to close the editor. Learning To Derive Double-click the Derived Column transformation to open the editor. Add One

刘未鹏 | Mind Hacks | 思维改变生活 SQL Server Tutorials and Tips Editing Published SSIS Package in SQL Server 2012 | Ms SQL Girl So, you have inherited a set of SQL Server 2012 Integration Services projects that have been deployed on a server. Your company do not use source control so you can’t easily see what was last published (Oh no!!). Or, you have deployed something on the server but you are not sure if it is the right version. Bottom line is you want to inspect or to edit a package that is already published on the server. Unfortunately at the moment there is no way of just quickly downloading that single SSIS package. SQL Server 2012 Integration Services now is now making use of Project Deployment Model. A. B. Caveat: Both these options require access to the project on the server. Option A: New Project 1. 2. 3. 4. 5. 6. This option is one of the safest / simplistic ways of getting SSIS project from the server. Option B: The shortcut 1. 2. 3. 4. 5. 6. Note: If the server is in Production, you could ask your DBA to export the .ispac file of the project (Step 1 & 2). Would it work for SSDT Visual Studio 2012?

乱象,印迹 上周五到周日,72小时内连续参加了北大、武大两场校园招聘会,笔试加上面试,总共见了一百多位同学。其中有很多很不错的同学,在学校里就积累了相当的经验和见识,相信这些同学将来一定有很好的机会;同时也见到不少同学因为各种各样的问题,没能顺利走完招聘流程,让人感觉非常可惜。下面我结合自己经历的校园招聘安排,给各位找工作的同学一点建议。 校园招聘的第一个环节通常是笔试。 笔试的题目一般由客观题和主观题组成。 相比客观题,主观题考察的能力更加多样化。 有些主观题是没有标准答案的,考察的是应试者理解问题的能力和分析问题的思路。 笔试中还有一点需要注意,就是时间的分配。 笔试之后,通常会进入群面的环节。 还有些同学听懂了问题,英语的表达也比较流畅,但给出的答案是“我最大的成就是我考上了大学”,也不容易得高分。 群面的另一个环节是无组织小组讨论。 通过群面之后,就进入到一对一面试的环节。 SSWUG.ORG Import XML into SQL Server using SSIS - Jon Tavernier - Blog This example was written using SQL Server 2008 R2. In SQL Server 2005, Microsoft introduced the XML column data type. I find it much easier working with XML directly in SQL Server over using the built-in XML Source component in SSIS. This example shows loading two XML from the file system into a SQL Server table using SSIS. Package Setup First, setup a Foreach Loop Container (FELC) to loop over the directly in question and assign the file name to a variable. Within the FELC, add a Data Flow Task (DFT). Extracting the XML file contents from the file system (Script Component).Converting those contents to Unicode (Data Conversion).Storing those contents into a SQL server table (OLE DB Destination). Script Component The script component is setup to take two input Read Only Variables: the directory and the current file name being processed as passed from the FELC. Data Conversion Storing in SQL Server The two XML files loaded were rather small: Here they are loaded in SQL Server: Questions? Share

App 2.0! | AnimeTaste 你所见到的,将是一个全新的App。 我们用两个月的时间重构了所有的底层代码并重新设计了所有界面,力求让大家能在移动设备上获得更好的观赏体验。现在无需下载即可在线播放,并且可以通过微博分享给所有朋友在线观看。 我们将会一如既往的坚持AnimeTaste选择动画的标准,从主站中精选内容,为大家带来全球更多的精彩动画短片,让你随时随地可以对创意启迪,对灵感充电。 同时,我们为所有人都准备了一份独立播放页面,当你把你喜欢的动画通过微博或邮件分享出去的时候,每个人就可以通过链接在浏览器中看到你的分享。 最后,如果你有什么推荐的动画,请不要忘记发给我们tougao@animetaste.net 你的眼中有大家的世界。

Related: