.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

Help with FOR EACH... or better approach

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :Sql Server

Good Morning,

I'm working on an ASP.NET 3.5 app that uses an MS SQL 2008 backend.  The db has a couple of related tables: tblGoals and tblGoalsProgress.  tblGoals currently has only three entries but the end user will have the ability to add additional goals, if desired.  Based on the three entries in tblGoals, I created the following query:

DECLARE @StartDate datetime, @EndDate datetime
SET @StartDate = '1/1/2010 12:00:00 AM'
SET @EndDate = '12/31/2010 12:00:00 AM'

	SUM(CASE WHEN GoalsEffected = '1' THEN Rating ELSE 0 END) AS [Goal 1], 
	SUM(CASE WHEN GoalsEffected = '2' 

View Complete Post

More Related Resource Links

SDLC Approach or Software Development Life Cycle

SDLC process stats from conception to completion of any software project. According to this approach the software development team is responsible for the whole project development life cycle. After doing SRS and requirements analysis; developers follow different models of Software development Life Cycle (SDLC) available, while the most common model is SDLC waterfall model. They divide project in different stages & phases and the output of each stage or phase becomes the input for next stage.

Application Architecture: An N-Tier Approach - Part 1


Free Trial: SQL Backup Pro
Sponsored by Red Gate
Exceptional DBAs make the most of their office hours. That's why they love Red Gate SQL Backup Pro. Its faster, smaller, secure SQL Server backups mean more time spare to accomplish more tasks and professional training. Make time to be an Exceptional DBA. Download it now! »

Free Trial: SQL Toolbelt
Sponsored by Red Gate
The SQL Toolbelt is a set of twelve powerful and intuitive tools that will help you burn through SQL Server chores with astonishing speed and accuracy. Download it now! »

Download: SQL Backup Evaluation Center
Sponsored by Red Gate
Download the T-SQL scripts in the SQL Backup Evaluation Center to compare Red Gate SQL Backup Pro's compressed backups with the size of backups created using native SQL Server. Download it now! »

Autodesk Inventor®
Go Beyond 3D To Digital Prototyping With Autodesk Inventor. Learn How.
Virtualization Solutions
Optimize, Simplify, & Save Today. Learn About Microsoft Solutions.
Microsoft SQL Server® 2008 - Free Trial
Download the Free 180-day Trial of SQL Server® 2008 Enterprise Edition!
Hot Careers in Internet Marketing
Get prepared for your new career with online degrees from Full Sail University!
Microsoft Te

Geneva Framework: A Better Approach For Building Claims-Based WCF Services


Here we introduce Microsoft Code Name "Geneva," the new framework for building claims-based applications and services, and federated security scenarios.

Michele Leroux Bustamante

MSDN Magazine December 2008

Threat Modeling: Uncover Security Design Flaws Using The STRIDE Approach


Whenever you build a new system you should consider how an in¬truder might go about attacking it and then build in appropriate defenses at design time.

Shawn Hernan, Scott Lambert, Tomasz Ostwald, Adam Shostack

MSDN Magazine November 2006

Approach using Regex in TSQL text manipulation

Hi there I have this following data: 0297144600-4799               0297485500-5599 The 0297485500-5599 based on observation always on position 31 char from the left which this is an easy approach. But I would like to do is to anticipate just in case the data is like this below which means the position is no longer valid: 0297144600-4799      0297485500-5599      0297485600-5699 As you can see, I guess the first approach will the split by 1 blank space (" ") but due to number of space is unknown (varies) how do I take this approach then? Is there any method to find the space in between and shrink into 1 blank space (" "). I am exploring Regex not sure how to do this and what I can think of is that if the blank is space can somehow reduce from xxx to 1 and I can handle this the rest. Thanks dewacorp.alliances

Best approach to handle concurrent requests in winforms

I have a windows client application which would be used many users. This application submit requests to run a workflow (note that this is not a WWF or WCF service, its a class library thats gonna do some processing). What would be the best approach to code this? Would processing each request on a separate thread be a correct way? I am a newbie at this. PLease help. Thanks!

Best approach to handle concurrent requests in winforms

I have a windows client application which would be used many users. This application submit requests to run a workflow (note that this is not a WWF or WCF service, its a class library thats gonna do some processing). What would be the best approach to code this? Would processing each request on a separate thread be a correct way? I am a newbie at this. PLease help. Thanks!   

best approach to a simple problem.

let me preface this with saying, i dont really know css or javascript or even xml really. i know enough to do what i need to, i dont know best practices, i can just get it done, so im aksing this to make sure the way i plan on doing this is a good way. just need to be pushed in the right direction. so im looking to make a simple webpage (client side only) that allows a user to pick colors for a IDE (think Visual Studio) so what i want to do is show a segment of code that shows something of all color types.. so think of a code segment like this response.write "hello world" there could be 4 different colors in this... the object, response, the period (it has a name, i forget it), the member, write, and a type, string.. so what im thinking is that there is some text on the page and a drop down that lets you pick the type to color, and then the color... so im thinking to use div tags to identify each type <div id=object>response</div><div id=period>.</div> etc etc and then do an on change for the color drop down to update the colors.. so i can do that, but the question is, im wanting to use CSS/XML so that way, if i get a couple of themes, i can then add a theme drop down to show some premade setups... default.xml <options> <object>red</object> <period>black</object>

What is Better Approach (Have Single Package or two Packages)

Hello, I want to design a package that will have 2 parts (2 parts of data flow). The package will be executed by scheduled Agent JOB. One part (DFT) should load data daily while the second part should load weekly. So I am thinking of 2 approaches: 1) Design 2 packages - one for each and have 2 Jobs scheduled accordingly 2) Design one package and use constraint to check current date/day. Execute first part and if this is Sat then the second DFT. Please advise. Thanks, Prabhat

one-stop coding approach

Unlike C++,both JAVA and C# promote a one-stop coding approach to code maintanance. Please explain.

Proper Approach for Monthly PDF Reports for Small Business?

Hello, all. Previously, our environment included an installation of WSS 2.0.  One of our most widely-used "features" was a page of links to reports on network file shares.  No one liked or trusted the Document Libraries, so we continued to store our weekly & monthly reports at places like \\fileserver\r-drive\MonthlyReports\2010\08\Sales\LicenseActivationReport.pdf and then created a bird's nest of links on our WSS "Reports" page to allow folks to find the information they were looking for more easily.  I'm not talking about a Links List, but a page of text with about 30 links to individual reports whose locations changed at least monthly.  These reports are roughly 70% PDF (exported from Crystal Reports), 25% Excel, and 5% Word. Today, we have an installation of MOSS 2007 Standard.  The collaboration and document management features are taking off quite nicely, but the staff is understandably itching to migrate the above-described "Reports Page" from WSS 2.0 to MOSS 2007. I can think of a few different approaches to this situation: We could reproduce a text page with 30 links to places like file:\\server\share\report.xls, but this seems contrary to SharePoint's mission.  It's certainly contrary to what I told the staff during training:  "Don't turn SharePoint into a bird's nest of links to ext

VisualStudio and SP Designer: what approach for sleek development?

Hi to all, we work at fairly complex SP based applications: our sites are rarely just document libraries or simple lists, so we usually have a bit of coding behind them. Until the latest release, we always worked on VisualStudio only, avoiding the SharePoint Designer, to create easily deployable applications that we can develop and test in an environment different from our production one. VisualStudio 2010 makes the whole process more enjoyable thanks to the new templates and a better overall integration with SharePoint Server (Deploy etc). The new Designer, also, is much better and we'd love to start using it. Laying out a site is a breeze with it, but we often fall back to the need of some hard programming on the code-behind. What is the better approach to SP development? What is the suggested way to seamlessly work with the Designer (using it to make up the lists, the pages and so on) and VisualStudio (to add non standard features and coding) and pack it all for an easy distribution? Ho to integrate the standard deploy features like exporting templates, packaging a solution from VS and so on? Any suggestion or link appreciated.

MOSS 2007 to SharePoint Server 2010 Hybrid Upgrade Approach on Windows Server 2003 x64

There's some guidance circulating about upgrading to 2010 with a mix of In-Place and Database Attach upgrade methods. My Central Admin and SharePoint Web App are on a 64 bit server, but it's running on Windows server 2003 x64 and not on Windows Server 2008 or 2008 R2. SharePoint Team Blog says Server 2008 or 2008 R2 is required for SP2010. If I want to do the hybrid upgrade approach, is it possible to first upgrade the OS to Server 2008 R2 on the server where my Central Admin and SP Web App runs?  Or will this break MOSS 2007?

Best Approach for Time Entry System

 Hi folks, need to get some ideas on the best approach for writing a system to log employee and equipment hours, based on the database backend for Abra Timesheets.  This app will only be responsible for entering things like an intra-company group and division and will probably associate equipment hours with a particular person so it will log equipment hours along with the operator/user.  Of course, equipment hours will be able to be modified apart from an employee's hours.  The immediate requirement is that it be Web-based, but there may be a need for it to be disconnected as well.  Is this a job for a Silverlight interface with a dataform, with the potential that it be saved on the user's computer and use an XML data store temporarily when disconnected.  I suppose a smart client app executed from an intranet site could be possible as well?  Any better ideas of the right way to do this? TIA, Steve

Which is the best approach for applying business rules and basic validation like data types?

Hi Everybody   Please suggest me the best approach for applying the business rules and data type validations .Here is my choices : 1)Sequential work flow 2)State machine work flow 3)Work flow rule engine 4)Rule engine without workflow Out of above choices ,which is the best approach? Please provide me the reasons or senarioes for which is the best approach for applying the business rules and also performancewise. My requirement is : After getting the reports ,need to apply the datatype validations like valid or invalid date ...etc to the reports .And stored into Database.In the next step,need to apply the business rules to that reports in such a way that data should be good quality. Thank you very much

Which is the best approach out of 'workflow' or 'rule engine without workflow' for business rule

Hi Everybody   Please let me know which is the best approach for applying business rules from out of 1)windows workflow 2)rule engine without work flow Please give me the scenarioes where exactly used? Thanks in advance..my dear friends  

Ideal approach? - Shared Classes or Non Shared (Object based)

Whats the ideal approach while developing an  ASP .Net application.1. Using normal classes and then using their functions by making objects? 2. Using Shared (Static for C#) classes and their shared functions and accessing them without creating the objects.My questions areWhat are benefits and drawbacks of above both?Can we face issues in simultaneous access of functions in 2nd case?Will there be separate copies of functions and variables in memory for 2nd case or just a single copy?What if our SqlConnection, SqlCommand and SqlAdapter are also shared? 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend