In TIP #70 we saw how to find all the running SQL SERVER instance in a network or a machine.
to revise see below image.
This tip is just opposite to tip #70 you don’t want that your co-worker see your SQL Server instance running on your machine machine. (There are several reason behind this and security is one of the most valuable aspects)
To achieve this you just need to do a very simple setting. Just follow below steps
1) Open “SQL SERVER Configuration Manager”
2) Once the screen is open right click on the instance which you want to hide from network (under SQL SERVER network configuration ) as shown below
3) When you click on Properties menu you will get a new screen as shown below
You need to set the value of Hide Instance option to Yes.
4) Click on apply button and restart the services.
Great , We achieved it. Isn’t it simple ?
I appreciate your feedback.
To determine size of table in a database or size of database, we have simple syntax in SQL Server which is SP_SPACEUSED.
Syntax is simple enough as shown below
1) If we want to determine size of the database then we have to write below statement and execute
2) Now to determine size of particular table we need to write following syntax
3) Now to determine size of each table in a database we need to write following syntax
SP_MSFOREACHTABLE ‘SP_SPACEUSED ’
4) When we are running sp_spaceused it may possible the size is not updated so to make sure size is updated we need to write following command
SP_SPACEUSED @updateUsage =N’True’
In the output of each statements we are seeing reserved, data,Index_Size & unused columns.
1) reserved column shows total space reserved by object.
2) data column shows total space used by the data.
3) index_Size shows total space used by index in object.
4)unused shows total space reserved by object but not yet used.
For more information you can visit following link
Sometimes you stuck in situation where you need to run same set of queries on different servers.
Sometimes it is a real pan when you need to fetch records from all the server then basic approach you follow run query on different instance once by one.
I would like to share here one important facility provided in SQL Server management studio which is
With the help of Register Servers option you can run same query for the entire servers which you have registered.
You can access the “Register Servers” option from View ==> Register servers OR by pressing “CTRL + ALT + G” keys.
As shown below fig
Once you press the menu or follow above keys then you will get Register Servers option screen as shown in below fig.
You can right click on Local Server Groups and can create your own group also
Once the group is created you can move your Registered servers on which you want to run query in that group with right click move option on Group Folder
As you did this job your database server will come in the particular group folder as shown in below fig
Now right click on your group folder and go for option New Query
As you go for option new query a new query window will be open there
Now write proper query which you want to run on same database at different servers and execute it with F5 option
You will find when you will execute the result will show in query result window which is just below the query with starting column server name.
Now you have option whether you want merge result or Individual result.
To check that option you need to go Tool –> Option then Query Result option as shown below fig
This trick will help you in many ways to get the results from different server as well as to find results from different servers.
Thanks & Regards,
Keep Learning, Keep Sharing
Today I am going to share one of the interesting options of SQL Server Management studio which may be unknown to most of us.
Now you are thinking what it is? So the cool feature is you can
run DOS command in your SQL Server Management studio
I know your next question is how?
My answer is just follow below step
Go To Tool –> Option
After option window open you need to select Query Execution tree and Select checkbox for
“By default, Open new queries in SQLCMD Mode”
Now open new Query window and write following command
!! Dir C:\
And hit F5
You will find below in the query result you have directory & files of your current C drive.
Just check below fig to understand.
In this way you can run various DOS commands.
!! Dir C:\New Folder
Isn’t it cool feature.
I hope you enjoyed it.
Keep Learning, Keep Sharing
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.
To know various options let us write following command
You will get following screen and you can any option from below screen to proceed further.
I hope you enjoyed the trick.
Thanks & Bes Regards, Rajat Jaiswal
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.
(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
I get following screen
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
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
I hope you enjoyed this information.
Thanks & Regards,
Keep Learning, Keep Sharing
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
option also. Just follow below steps and you are good to go for database changes also
Go to following menu in Visual Studio as shown in below Fig
Data ==> Data Compare ==> New Data Comparison
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.
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.
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.
Step 5:- Now with show data update script menu option you can generate script.
Now just copy & paste and you are good to go.
So I hope you understand the essence of this utility also.
Keep Sharing 🙂
“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.
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.
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
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
Step 5:- Now you are ready to run the changes because you have all the changes script like I have in below fig.
I hope you enjoyed this.
Enjoy learning & Sharing.
Thanks & Regards,
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
2) Once you have unload the project you will get below screen
3) Edit the unload 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" />
<JS Include="**\*.js" Exclude="**\*.min.js;" />
<CSS Include="**\*.css" Exclude="**\*.min.css" />
<AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".min.js" CssSourceFiles="@(CSS)" CssSourceExtensionPattern="\.css$" CssTargetExtension=".min.css" />
Like suppose earlier you have Site.css then now you will find site.min.css also.
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,
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
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.
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.
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
Thanks & Best Regards,