Compare records of each tables of Source & Target database

Dear Friends,
In last post we have seen how easy to find the database changes and generate script for the changes that will help you in deployment.

Similarly sometimes you need to know

row by row data difference in two databases

so don’t worry about that because visual studio 2010 provided

data comparison

option also. Just follow below steps and you are good to go for database changes also
Step 1:-

Go to following menu in Visual Studio as shown in below Fig
Data ==> Data Compare ==> New Data Comparison

dataCompareOption
Step 2:- When you click the above provided menu then you will get following screen. Just configure the

source and Destination databases

.
Check record comparison options which you want like different records only, only in source, only in destination, identity records etc. Now press NEXT button.

DataComparision

Step 3:- As you press the next button you will find the screen where you can select all or particular table or view for comparison as shown in below fig.

Datacomparison_Table_Selection

Step 4:- Once you have selected the particular table(s) and view (s) you will get following screen where you can find table wise comparison like, How many identical records in both tables ?, How many records exists only in source table?, How many records exists only in destination table ?

And below the comparison grid you will find different tabs also for different result sets you just need to select the tab to see the records associated with those particular criteria.

DataComparision_ResultSet

Step 5:- Now with show data update script menu option you can generate script.

Database_Comparison_Result_Set

script_After_Data_Comparison

Now just copy & paste and you are good to go.
So I hope you understand the essence of this utility also.

Enjoy .NET
Enjoy learning.
Keep Sharing 🙂

Your host
Rajat Jaiswal

Are you a smart Dotnet Developer?

Dear Friends,

As you are using Microsoft Visual Studio you have proved you already a smart person.
Most of the time we are doing lot of hard work to execute a project. If we see our back so we observe that we write thousand of the lines for a project (without actual logic). Sometimes a minor project can take number of days to complete.
When you think about a project most of the time we have to write same line of code except the core logic.  But again we have to write whole bunch of lines for the project and put lot of efforts from our side.
I realized that sometime I am only hard working programmer not smart programmer while I have many options provided by Microsoft to make myself a smart work. Although I tried many times to be smart programmer as you have seen in my previous articles like database utility, three tier architecture code generator, Macros code generator etc.
Here I want to share a small utility provided by Microsoft visual studio which will be a step towards making our self smart. Although this topic needs to be introduce in the same series of code generator but I am really sorry, I missed this utility at that time. Recently one of my friends asked me this question so I thought this should be share with every one because we are a team.
I know some of you aware of this utility, some of you using this but it is for those friends who really wants to improve and not aware of this.
The utility function is “Snippets “.  Are you surprised? , I don’t think so.
A snippet is a utility provided by Visual studio which is helpful in making us smart programmer.
We can access the Snippets by using Ctrl + K, ctrl + X key. When you press this in visual studio you will get the list of existing snippets codes existing is visual studio. We just need to select particular code which we required and change small variable declaration and bang, we will find we write a complete code in few minutes.
As shown in fig (1) we are accessing crystal report code


Great fig (2) shows we created bunch of lines for accessing crystal report by just simple clicks  one  more great thing is you don’t need to add reference in your code for require DLL the snippet automatically handle that.


We can create our own snippets and use them. For this we have to create a XML and whose structure is as follows.
<CodeSnippets
xmlns=”http://schemas.microsoft.com/VisualStudio/2008/CodeSnippet“>
<CodeSnippet Format=”1.0.0″>
<Header>
<Title>
Complex logic of Rajat Snippet
</Title>
</Header>
<Snippet>
<Code Language=”CSharp”>
<![CDATA[
We can write n number of lines here with complex code
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

I hope it would be helpful topic enjoy smartness.

I urge you to share more utility which make us smart programmer.
Thanks & Regards
Rajat Jaiswal

Utility for Printing all the PDF from a folder

Hello friends,
Recently one of my friends needed a utility. According to
his need the application just select the folder and print all the PDF files
which are in the folder.
So I made a simple windows application which execute acrobat
reader exe with /h/p option which print all the PDF one by one.

You can download the source code from

http://cid-1eda2012469ff8ad.office.live.com/self.aspx/.Public/RAJAT%5E_JAISWAL%5E_PRINT%5E_PDF.zip

Enjoy utility.

Thanks & Regards
Rajat Jaiswal

Restore Database from Zip File in SQL Server.

Recently one of my colleagues shared a link which is very useful in many ways.

 http://clay.lenharts.net/blog/category/mssql-compressed-backup/

The link is very useful for restoring compressed backup. Hope this will help you also.

trust me it saved my whole day work because my production database size is  100 GB.

Thanks & Regards

Rajat Jaiswal