How to open SQL Server with command prompt with various option?

Dear All,

Today I am going to share some small dos which will helpful to open SQL Server Management Studio.

I am sure you are curious about

how to open SQL Server Management studio with command prompt.

So Let us start Currently when you go through SQL Server Management studio you have to process 2 step means first click the SQL server Management studio by clicking icon then login to the server.

Now check this out write following command in dos command prompt and press enter

C:\> ssms –E

You will find your SQL Server Management studio open without any prompt of Login authentication because here E stands for windows Authentication mode.
Now go deeper write following command

C:\>ssms –E –NOSPLASH

Now you found that the splash screen also not coming ,So similarly you can find various options to open SQL SERVER Management Studio using command prompt.

SSMS-E-NOSPLASH
To know various options let us write following command

C:\ssms/?

You will get following screen and you can any option from below screen to proceed further.

ssms

I hope you enjoyed the trick.

Thanks & Bes Regards, Rajat Jaiswal

Facebook Graph API- Is it Simple to Fetch Facebook users information with simple URL (Y/N)?

Dear Friends,
Today I am going to share some small tips to

access Facebook account related detail using Graph API.

Facebook Graph API is one of the easy tools to access Facebook Information and incorporate in your application.

Suppose you know the Facebook name of the person and if you want to know First name, last name, Facebook Id and Facebook page of the person then you just need to write following URL in your browser.

http://graph.facebook.com/Facebookusername

(You just need to Replace Facebook Username by Facebook actual username Or Facebook ID)

Let us try with my Facebook username when I write below URL in browser and hit enter

https://graph.facebook.com/rajat.jaiswal.902

I get following screen

Facebook ID by Facebook Usename

Similarly if I know the ID then I can also get above screen. Now write following URL in browser you will get exact same screen

https://graph.facebook.com/771700761

Going further I know curiosity increased now you want see Facebook Picture also of the person then no issue we are going to show the image also with same Facebook Graph API

For this you just need to write following URL in your browser

 

https://graph.facebook.com/FacebookId/picture (You just need to replace Facebook ID)

For example let us run it with my Facebook ID

 

https://graph.facebook.com/771700761/picture

I hope you enjoyed this information.

Thanks & Regards,
Rajat Jaiswal
Keep Learning, Keep Sharing

ORDER BY Issue WITH Temporary table in SQL SERVER ?

Dear Friends,

Yesterday was a very good learning day for me. One of my colleagues stuck in a very interesting issue.
He was fetching records from database with an ORDER BY clause on a VARCHAR field.
Couple of records of his table containing “-“hyphen symbol in the field on which he applied Sorting.

So after facing that problem I am sharing how to use collation in ORDER BY CLAUSE with your select statement.

Let’s consider below example

DECLARE @tblSubjects TABLE(
Subjects VARCHAR(100)
)

INSERT INTO @tblSubjects VALUES (‘HINDIBALBHARTI’)
INSERT INTO @tblSubjects VALUES (‘HINDI-BALBHARTI’)

SELECT Subjects AS Default_Collation_Sort_Order FROM @tblSubjects ORDER BY Subjects ;
SELECT Subjects AS Explicit_Changed_Collation_Sort_Order FROM @tblSubjects ORDER BY Subjects COLLATE Latin1_General_CI_AI ;

When you run above statement you will get different order in result set.

ORDER BY ISSUE in temp Table
Generally this problem occurs when you use temp tables and your sort order and it is not as per your expectation.

So if you found this type of ORDER BY issue than you can explicitly use COLLATION

Enjoy learning.

Your host
Rajat Jaiswal

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

Make SQL Server Database Changes deployment easy with “Schema comparison”

Dear friends,

“Database Changes deployment”

, hmm little bit scary topic. But don’t’ worry
Today I am going to give a brief introduction on

Schema Comparison feature of Visual Studio 2010.

I think most of the people are not aware of this. This tool is one of the best helping tools for your deployment process.
Suppose you have made all the changes in your local database which are related to stored procedure, database schema and by mistake you are not aware what changes you have made so far which are not exists in your staging or production server.
Your first thought is to compare both the database and generate script for changes and just deploy on target database.

So Visual Studio 2010 makes your life easy with a new Feature which is called “Schema Compare”.
Just follow the steps as show below and you are good to go for any database changes deployment :).
Step 1:- Open Visual Studio 2010 Go to Data Menu Schema compare then New Schema Comparison and click it. You will get following screen.

Schema Comparision
Step 2:- Just define the Source and target database connection string in the above screen and then press OK button. Once you press OK button the Visual Studio compare the source and target database each object like tables, columns, store procedures etc.

You will get following screen which shows difference in source and target database in “Update Action” column.

Schema comparision detail
Step 3:- With Update Action column you can choose whether you want to keep these changes in the final script or not as show in below fig

Schema compare action
Step 4:- Now when you are assure that you want selected changes on target server also then you can on “Export To Editor” or “Export To File” option as shown below

Export to File
Step 5:- Now you are ready to run the changes because you have all the changes script like I have in below fig.

Generate Script output

I hope you enjoyed this.
Enjoy learning & Sharing.
Thanks & Regards,
Rajat Jaiswal

How to boost performance of my ASP.NET Website ? Part -II

Dear Friends,
As we have shared earlier how to optimize image (part1) to improve site performance to continue with that topic. I have going to share one more useful topic how to minimize the CSS & JS used in your project.
If you remember Microsoft Ajax minifier (AjaxMinifier) which I have shared earlier in my post we can utilize that tool to

minimize size of the JS & CSS.

So earlier I have explained how to use command prompt to minimize the CSS & JS.
Today I am going to share how to minimize the all the JS & CSS in your project while doing rebuild it.
So here we go just follow below steps.
1)    Go to web solution and unload it  as show in below fig

Boost perfromance of website
2)    Once you have unload the project you will get below screen

Edit project file
3)    Edit the unload project file

Add minifier in project file
4)    Your file will be open in  IDE now add the below lines in project files

<Import Project="$(MSBuildExtensionsPath)\Microsoft\MicrosoftAjax\ajaxmin.tasks" />
<Target Name="AfterBuild">
<ItemGroup>
<JS Include="**\*.js" Exclude="**\*.min.js;" />
</ItemGroup>
<ItemGroup>
<CSS Include="**\*.css" Exclude="**\*.min.css" />
</ItemGroup>
<AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".min.js" CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".min.css" />
</Target>


5)    Now reload the project and build the project. Now refresh the solution and click on show all files. You will some extra files for JavaScript (JS) & CSS file which have same name  and “min” word added in the file.
Like suppose earlier you have Site.css then now you will find site.min.css also.

minimized css & JS

So it is clear now.

Now we can use this compress “minimized” CSS or JS file.
In this way we can use minimized CSS & JS improve the website performance.

So enjoy the New Year with fast performance of the site.
Happy New Year
Thanks & Best Regards,
Rajat Jaiswal

How to boost performance of my ASP.NET Website ?

Dear Friends,

Why my website is slow?

I know this question come in your mind several times.  So I will try to help in boosting performance of your website with sharing some of the utility which helped me hope it will help you also.
As a developer I know the first basic problem is image optimization. So let us fix the image optimization issue first.  To resolve we are going to use image optimization extension.

To download it goes to Extension manager (Tool –> Extension Manager) and search image optimization. You will get following options as shown in below screen

ImageOptimizationExt

Now install the image optimization. It will ask to restart the visual studio. Now just right click the image folder of the project.  You will get image optimization menu as shown in below fig.

optimizationOption

When you run it you will find that the image in that particular folder is optimized and as a output you will get following screen.

output_of_Image_Optimization

As we already know if the size of the page content over the network is less then it will render fast on client machine. So image optimization help in reducing the network size.
I hope you like this post and it may helpful to you either today or may be in future.
I am going to share some more tips related this topic so stay connected
Enjoy.
Thanks & Best Regards,
Rajat jaiswal

A new milestone 125th post on Indiandotnet.wordpress.com so far so good

Dear Friends,
This post is different post from my regular technical articles and it is my 125th post on Indiandotnet.wordpress.com.

I would like to thank all of my friends, family members, colleges & most valuable the reader of this blog who continuously giving feedback and improving my skill also.
So thank you very very much.
Keep reading, Keep commenting, and keep giving feedback.
I need more improvement and I know you people will help me in sharing my thoughts.
God bless you all.


Happy Holidays.


Merry Christmas.
Thanks
Rajat Jaiswal

HTML to word doc at runtime simplest trick

Dear Friends,
Recently my friend got a new task to generate a word & PDF document at runtime from FCK Editor and he was in real hurry, so he told me a sample for him. I tried with a simple which I am sharing here.
I created a resume layout with FCK editor. Please find the below screen and code.

HTML to word

now code is here

Generate html to Word
I hope you will also enjoy.

you can download code  at
https://skydrive.live.com/embedicon.aspx/.Public/RAJAT_INDIANDOTNET_HTMLTOWORD.zip?cid=1eda2012469ff8ad&sc=documents
Thanks & Best Regards,
Rajat Jaiswal