Tuesday, June 29, 2010

DevCon 2010 - The mega event by k-mug

Why attend DevCon 2010?

Because you’ll return to the office with cutting-edge insights and expertise that will make life easier for you (and everyone else) at work. Immerse yourself in IT learning opportunities and get your questions answered by renowned technology experts. Even more importantly, engage and collaborate with Microsoft MVPs and thousands of your IT peers, building connections that will last beyond your two days at DevCon.

When

03 (Saturday) and 04 (Sunday) – July – 2010

Where

ParkCenter, Technopark, Trivandrum, Kerala, India

Register

Register for DevCon 2010 in Trivandrum, India  on Eventbrite

Speakers



  • Ramaprasanna Chellamuthu works with Microsoft as a Developer Evangelist.

  • Manu Zacharia is an Information Security evangelist with more than 16 years of professional experience and MVP in Enterprise Security. Currently he is associated with Millennium Consultants as Director – Information Security.

  • Praseed Pai is a well known software architect from Kochi,Kerala. His blog can be accessed here. His open source compiler SLANG4.net got many fans.

  • Anoop Madhusoodhanan is a Solution Architect at UST Global and a Microsoft MVP in Client App Development.

  • Sreejumon is the founder and Community Council member of Kerala Microsoft User group (www.k-mug.org). He is currently working with Nokia R&D Center Bangalore as an Architect. He has been MVP for past 8 years.

  • Vijay Raj works at Texas Instruments Bangalore focusing on Application Setup and Deployment. He is a Microsoft MVP (Most Valuable Professional) and a Springboard Series (STEP) Member for Windows 7. He is also a regular speaker at the user group communities and other events He blogs at http://www.msigeek.com.

  • Jeen Shene Stanislaus is a Technical Evangelist with Education & Research, Infosys, Trivandrum.


  • Shiju Varghese is a Technical Architect on the Microsoft .Net technology stack with a focus on web application development and Domain-Driven Design. blogs at http://weblogs.asp.net/shijuvarghese/.

Contests

The Great Developer Contest!

Participate in the great Developer contest and win cool prizes. Do you have a killer solution idea related to Twitter? Do you think you can put better use of Microsoft Tools and Technologies? Then “The Great Developer Challenge” is the perfect game for you. Showcase your idea related to Twitter and win Cool prizes.

Sounds Interesting? These are the rules

  1. Only one idea per person is allowed
  2. The idea can be related to any domain, but should be using Twitter
  3. Prepare at least a 5 slide power point presentation about your idea and how it can implemented using Microsoft technologies.
  4. No working prototype is required. All you need is think out of the box ad come up with a cool idea.
  5. Only registered K-MUG members are eligible for the contest.
  6. Judges decision are final.
  7. First 3 winners shall get cool prizes.

Prize 1: Nokia Touch Screen Phone
Prize 2: Pluralsight training
Prize 3: Windows 7 DVD

Idea and implementation details should be submitted before June 30th (max 8 slides) – Short listed finalists should present their design during the DevCon 2010, and there will be questions from the expert panel. Winner will be announced at the end of the DevCon. Please send your entries to admin@k-mug.org, and contest related questions can be posted here.


K-MUG Video Contest – Here is a chance to show your creativity and movie making skills. We have a bunch of snaps here under K-MUG media section (http://k-mug.org/media/3/default.aspx ). All photos are taken during our past events. As part of this contest, you need create a video (10-15 minutes) by mixing different snaps and audio clips. Video can have text description as well (at least the event name). We will be showcasing the winning video during the DevCon inauguration, and you will get free entry pass and cool prize as well. Please send your videos to admin@k-mug.org before 30th June. Any questions related to K-MUG video contest can be address here.


Pre event blogging Contest – Best blog entry on DevCon 2010 (we should consider all the entries submitted before June 30th). Blog entry should be submitted in K-MUG forum under DevCon2010 Pre event blogging contest.


Post event blogging Contest – Best blog entry on DevCon 2010 (before July 7th). Blog entry should be submitted in K-MUG forum under DevCon2010 post event blogging contest.

Sessions

DevCon 2010 – 3rd and 4th July at ParkCenter, Technopark, Trivandrum

Day 1 (3rd July – Saturday)
08:30AM – 09:15AM – Registration Confirmation
09:15AM – 09:30AM – Welcome Speech
09:30AM – 10:15AM – Key Note Session – “Cloud – The Meta Platform”
10:15AM – 11:00AM – New features in .NET 4.0 & Visual Studio 2010
11:00AM – 11:15AM – Tea break
11:15AM – 12:15PM – Robotics Programming
12:15PM – 01:15PM – Web Security and Security Auditing
01:15PM – 02:15PM – Lunch
02:15PM – 03:15PM – Windows Azure
03:15PM – 04:00PM – Great Developer Contest – Final
04:00PM – 05:00PM – Managing Application Compatibility in Windows 7

Day 2 (4th July – Sunday)

08:30AM – 09:30AM – Registration Confirmation
09:30AM – 10:30AM – Data on the Cloud
10:30AM – 11:30AM – Mixed Mode Windows development using C# and C++
11:30AM – 11:45AM – Tea Break
11:45AM – 12:00PM – Visual Studio 2010 tips
12:30PM – 01:30PM – Tuning Tools in SQL Server 2008
01:30PM – 02:30PM – Lunch
02:30PM – 03:15PM – ASP.NET MVC2
03:15PM – 04:00PM – Windows 7 Phone
04:00PM – 05:00PM – Closing Ceremony

Sponsor Benefits

Sponsor/Partner benefits

DevCon provides you with an opportunity to reach an audience that spans both IT professionals and developers, all in one location. So you can meet your business and marketing objectives with just one investment of time, financial and staffing resources. At DevCon sponsors/exhibitors will have the opportunity to:

  • Increase awareness about your company and its product/service offerings via marketing exposure and a booth in the Partner Expo
  • Engage face-to-face with high-quality influencers and decision makers to establish new relationships and build on existing ones.
  • Take your business to the next level by leveraging your booth to engage with attendees, market your products, and qualify leads to develop and build a marketing database of future sales prospects.

By sponsoring K-MUG event, you get the better mileage and visibility because

  • K-MUG is one of the best developer community in India
  • K-MUG bagged the best user group award in India as part of Microsoft Community impact award 2010.
  • K-MUG is not a city based user group, instead it covers the entire state Kerala (God’s own country)
  • K-MUG’s track record of conducting the best user group events, Refer the media and press releases (http://k-mug.org/media/)


Platinum Sponsor

Logo under Platinum sponsor (DevCon site) , 30 minutes slots to talk about your product, booth near the venue hall, banner place outside venue, banner placed on the stage and front cover of the notepad (will be distributing to all attendees as part of the welcome kit)

Gold sponsor

Logo under Gold sponsor (DecCon site) , banner place outside venue and banner placed on the stage

Silver Sponsor

Logo will be added under Silver Sponsor (DevCon site) as well as banners placed out side venue

admin@k-mug.org if interested in sponsorship>

DevCon 2010






Event Details



http://k-mug.org/events/devcon2010/

ParkCenter,Technopark
Trivandrum-695581
Kerala


When

Saturday, July 03, 2010 at 8:30 AM
- to -
Sunday, July 04, 2010 at 5:00 PM (GMT+0530)


Where

Technopark

Trivandrum 695 581
India

Google | Microsoft | Yahoo

Saturday, June 5, 2010

SQL Server Error - “Saving changes is not permitted. The change you have made require the following tables to be dropped and re-created.
You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.”


  1. Scenario
  2. Interpreting the error
  3. Finding the root cause
  4. About this SQL Server feature
  5. Solution
  6. Conclusion

Scenario
You are very likely to run into this error if you are a beginner with SQL Server 2008. You could be working with SQL Server Management studio and trying to do any of the following actions
• Adding a new column to the middle of the table
• Dropping a column
• Changing column nullability
• Changing the order of the columns
• Changing the data type of a column

Suddenly SQL Server throws this error at you and you might be wondering what on earth you did that prevents you from just altering a table which might actually be created by you!!!




Interpreting the error

OK. So let’s try to understand what this error message is trying to say to us. It says that the changes that we are attempting require the table to be dropped and recreated. So either the table that we are attempting to change can’t be re-created or you have enabled some option to prevent saving changes to a table that requires the table to be re-created.
Here the first case cannot be true, because if we created a table, we should be able to drop and re-create it. So what about the second possibility? You may not remember enabling any option like that. What if by default SQL Server installation enables that option? Let’s find out.

Finding Root Cause

So let’s check the option that was mentioned above. To change this option, on the Tools menu, click Options, expand Designers, and then click Table and Database Designers. There we can see the Prevent saving changes that require the table to be re-created check box as selected.





So we have identified the root cause of this error message. Now what? If you disable the option what would happen? Of course this error message may disappear. But is there any side effects? Let’s find out what this option is for.

About this SQL Server feature

Here’s Microsoft’s word about this issue. (From MSDN)

Important We strongly recommend that you do not work around this problem by turning off the Prevent saving changes that require table re-creation option.

If you disable this option, you are not warned when you save the table that the changes that you made have changed the metadata structure of the table. In this case, data loss may occur when you save the table.

Risk of turning off the "Prevent saving changes that require table re-creation" option
Although turning off this option can help you avoid re-creating a table, it can also lead to changes being lost. For example, suppose that you enable the Change Tracking feature in SQL Server 2008 to track changes to the table. When you perform an operation that causes the table to be re-created, you receive the error message that is mentioned in the "Symptoms" section. However, if you turn off this option, the existing change tracking information is deleted when the table is re-created. Therefore, we recommend that you do not work around this problem by turning off the option.

To determine whether the Change Tracking feature is enabled for a table, follow these steps:
1. In SQL Server Management Studio, locate the table in Object Explorer.
2. Right-click the table, and then click Properties.
3. In the Table Properties dialog box, click Change Tracking.
If the value of the Change Tracking item is True, this option is enabled for the table. If the value is False, this option is disabled.

When the Change Tracking feature is enabled, use Transact-SQL statements to change the metadata structure of the table.

Solution

Now that we have found out the root cause and what this option is for, our recommended solution would be to script out the changes to a SQL file and execute them, or to simply write out our own T-SQL to make the changes. Although the other workaround will work it is not recommended (At least not as a permanent solution).

Conclusion

We have seen one of the common error messages that occurs in SQL Server 2008 while we try to make changes to table structures. We have interpreted the error message, found out the root cause and understood about this feature in SQL Server. We have found out the recommended solution for this problem and also looked into another workaround which works but is not recommended.
Dynamic Cross Tab Query in SQL Server

1. Introduction.
2. Real world scenario.
3. Solution.
4. Conclusion.

Introduction
Let us begin by examining what a cross tab query is and when to use it. A cross tab query is a transformation of rows of data into columns. It usually involves aggregation of data.
e.g. revenue generated by an employee broken down by days, where the days are represented by columns.

It's very hard to visualize without an example, so we will look into one below.

SQL Server 2005 and above supports PIVOT statement for building cross tab queries and we will be using the same in this article.

Real world scenario
Suppose we have a table called EmployeeSales for recording sales made by employees. For the sake of simplicity we’ll create a table as in Fig 1 below.

Fig 1.



One example of a cross-tab is to take the above data and show how much revenue each employee generated per day. This allows for easy comparison of revenue generated by each employee per day . We would want our resulting data to look like Fig 2 below.

Fig 2.


Solution
SQL Server has introduced many cool features beginning from version 2005 onwards and PIVOT is one such feature which can be used for formatting output as shown above.

Following is the syntax for PIVOT statement in SQL Server.



SELECT <-non-pivoted column>,
[first pivoted column] AS <-column name>,
[second pivoted column] AS <-column name>,
...
[last pivoted column] AS <-column name>
FROM
(<-SELECT query that produces the data>)
AS <-alias for the source query>
PIVOT
(
<-aggregation function>(<-column being aggregated>)
FOR
[<-column that contains the values that will become column headers>]
IN ( [first pivoted column], [second pivoted column],
... [last pivoted column])
) AS <-alias for the pivot table>
<-optional ORDER BY clause->;


So writing a PIVOT statement for our requirement looks like this


SELECT EmployeeName,
[03 Apr 2010],
[04 Apr 2010]
FROM
(
SELECT EmployeeName,
convert(varchar, SaleDate, 106) AS [Date] ,
Revenue
FROM dbo.EmployeeSales
) p
PIVOT
(
SUM(Revenue) FOR
[Date] IN
(
[03 Apr 2010],
[04 Apr 2010]
)
)
AS pvt


However PIVOT syntax in the above query requires us to give all the PIVOT column names hard coded in the query which obviously is not a cool thing.
How many times do we know in advance the columns that are to be pivoted?
But wait, If we could find some mechanism to generate all the pivoted column names that should appear in the output dynamically, Wouldn't that solve our issue?
Of course, Yes.
Good news is that it is not that difficult to generate a comma separated values of row data (in this case, the distinct dates) from the original result set.

We'll use an approach using COALESCE for this purpose.

Once we generate the comma separated values of distinct dates, we append it to out above PIVOT statement to build the complete query dynamically.
Then we execute the query on the fly.

So here goes our SQL code



-- Getting distinct Dates into a temporary table #Dates
SELECT DISTINCT convert(varchar, SaleDate, 106) AS [Date]
INTO #Dates
FROM dbo.EmployeeSales
ORDER BY [Date]

-- Building a comma separated list of Dates in #Dates
DECLARE @cols varchar(1000)
SELECT @cols = COALESCE ( @cols + ',[' + [Date] +']', '[' + [Date] + ']')
FROM #Dates

-- Building the query appending columns
DECLARE @qry varchar(4000)
SET @qry =
'SELECT EmployeeName, ' + @cols + ' FROM
(
SELECT EmployeeName, convert(varchar, SaleDate, 106) AS [Date] , Revenue
FROM dbo.EmployeeSales
) p
PIVOT
(
SUM(Revenue) FOR
[Date] IN (' + @cols + ')
)
AS pvt'

-- Executing the query
EXEC(@qry)

-- Dropping temporary table
DROP TABLE #Dates



Conclusion
So That’s it. We’ve just created a dynamic cross tab query in SQL Server. As you have just seen, PIVOT statement along with the capability to generate column names dynamically provides some very useful functionality in terms of formatting a result set as per our needs.

Thanks for reading the article. Do post your Comments, Suggestions and Views. Have a nice day and happy programming !!!