Category: SSMS

Quick Guide: Query Optimization Tips
Oct 11, 2019 4 min read

The most underrated but most important topic, which is a must while implementing the SQL Query, Stored Procedures, or Functions. While implementing any SQL operations knowing the syntax and structures is a good thing, but one must know optimization. Without knowledge of optimization, any developer can create DDL and DML statements, but they are not well-designed procedures. You know why? Because while executing those statements there are chances that it will take time or may create a deadlock situation. Proper joining is also considered to be part of optimization. This above is an actual execution plan flowchart. The most simple query execution flow is mentioned below: From Joins Where Group by Having clause Column list Distinct Order by Top From: First it will fetch all the records from the table mentioned after the ‘From’ keyword. Join: joins are an essential part of any SQL statements. A developer must have proper knowledge of tables; otherwise, it can cause the wrong data population of data or extended execution time. Where: It another filter applied to any query after applying joins. It is used to decrease no. of records provided filter wise. Group by: It is used for grouping the records with aggregate functions or grouping the records particular provided column-wise. Having: When we need to provide an aggregate function with a filter then we should use it in the ‘Having’ clause. Column list: While putting ‘*’, we are calling all the columns and all records from a particular table. If not necessary then we must provide only those columns which are actually useful. Distinct: It is used to remove duplicate records while fetching the details through a select statement. Order by: This is useful to sort the data ascending or descending column-wise. Top: It is used to limit the no. of records to be displayed on the screen. Above mentioned query execution flow is 1st step of the optimization ever keyword should be placed as per the above plan. The last 3 steps (7, 8, and 9) are most crucial because it will process all the records and then do operations accordingly. ‘Group by’ and ‘Having’ clauses are also taken time while execution because it uses aggregate functions in it. Along with that, it is necessary for you to know that if not necessary then don’t do for inbuilt functions. ‘Convert’ and ‘Cast’ is the most frequent built-in functions that can extend the execution because of conversion. As mentioned above Joins are the most important part of any SQL statement because a good join increases the performance where wrong can mislead you. First of all, while implementing a join please check whether tables are properly indexed or not. Indexing is very important while the creation of a table, a table must have at least one clustered index. The lessor or no use of temp tables. Temp tables tend to increase the complexities of the query because it increases the continuous use of ‘tempdb’ database. If necessary then create a clustered index on that temp table which increases the performance and doesn’t wait for the temp table to be dropped automatically, drop it when it is of no use. Go for the execution plan if the query is taking too much time, by seeing the plan we can easily fetch which query or portion of the query is taking the time. The execution plan shows which table used maximum process time from the overall time. Make your indexes unique using integer or unique identifier which increases the performances. A table must have one clustered key and can have one or more nonclustered keys. Use small data types for indexing. For the existence of any record don’t dependent on the count statement in the query. For example, Always use ‘with (nolock)’ keyword to avoid locks while fetching records from the table. Avoid the use of ‘NOT IN’ statement in where condition, instead of that you can go for let join. In the same way no need to go for the ‘IN’ statement, you can simply use inner join. Please avoid loops and cursors while creating any store procedure, because looping also causes CPU process usage and calling the same statement again and again. So avoid it is not needed. Use ‘UNION ALL’ instead of ‘UNION’ for combining two or more ‘select’ statements.  

Business Benefits of Negative Reviews
Oct 01, 2019 5 min read

So, you’ve somehow received a couple of bad online reviews. Is your business doomed? Certainly not! Even big brands have had their fair share of angry outpour from disgruntled customers and survived. While larger companies’ reputations can sustain a few blows without actually collapsing, small businesses can’t rely on the benefit of the doubt to amortize customers’ wrath as effectively. But you should actually be grateful for bad reviews, as they help your business grow. one out of twenty unhappy customers complain, and the other 19 leave without telling you “why.” This gives you no opportunity to learn from your mistakes or fix what’s broken. In fact, most brands hear feedback from less than one percent of their customer base. But we know that customer feedback is absolutely critical, and that we need to be gathering it at the right times and places. Negative feedback is like pain – it’s a warning that there’s something wrong and that you should do something about it. Without bad reviews, you’d be resting on your laurels while your business is crumbling and your customers fleeing. Here’s how you can benefit from these negative experiences and turn them into wins. 1. Own Your Mistakes The worst thing you can do upon receiving a bad review is turning a blind eye, trying to cover the problem up, or being hostile towards the customer who complained. Any of these approaches can hurt your reputation more than the negative customer experience itself. Even if the review is exaggerated and vicious, you shouldn’t try to “get even.” It’s crucial to always be polite, civil, and promise that you’ll look into the matter as soon as possible. By taking responsibility, you show that you’re willing to change and improve your customer experience, and owning up to your mistakes can be excellent PR. Texaco, one of the world’s biggest petroleum companies, was sued by former employees and accused of racial discrimination back in 1994. Instead of offering them hush money, Texaco took a totally different approach. The company’s CEO publicly apologized, while executives travelled to every office location to apologize in person. Finally, hiring an African-American-owned advertising agency to do its upcoming campaign was the crowning touch. 2. Show Your Customers You Care Business lost $75 Billion in 2018 because of poor customer service. If you ignore customer complaints, you’ll paint your business in a negative light. But if you carefully monitor what your customers are saying both to your customer service reps and in their online reviews, and respond to them, you show that their opinion matters. There’s another stat which illustrates the importance of handling customer complaints properly – people who have their issue solved during the first interaction with a company are two times more likely to purchase from the same. In order to ensure top-notch customer service, it’s a good idea to implement chatbots. These smart algorithms are like first responders in case of an emergency , and unlike your customer service reps who can’t be online and available 24/7, chatbots can: and they can offer troubleshooting and answers to some of the most common questions. They can collect your customers’ complaints and help you identify the problem. 3. Respond in a Timely Manner In 2014, General Motors faced a huge crisis after faulty ignition switches caused 124 deaths. The company had to recall 2.6 million vehicles over the first three months of the year. It would be an understatement to say that their customers were unhappy. Many of them took to social media to express their dissatisfaction, and G.M.’s social media team jumped in to save the day and the company’s reputation. Not only did the company respond to each and every message across different social media channels, it also provided their customers with immediate help by paying for replacement vehicles and covering the other expenses incurred as a result of the issues they had with their cars. But in order to be able to respond in a timely manner, you need to be aware of an upcoming PR disaster, and social listening is a strategy which allows you to track every mention of your brand, products, and keywords on different channels and spot the issue before it snowballs into a full-fledged PR armageddon. 4. Encourage Online Reviews Now that we’ve established that you won’t be able to save yourself from negative feedback (nor should you try to do so), it’s important to mention that you can always balance the scales with positive reviews. Many companies ask for online reviews directly and encourage their happy users to share their experiences with others. This can partially neutralize any negative review that throws shade on your business. Promote your customers at right time and place, within your app to boost five-star ratings. You can solicit positive reviews from people who love your app and intercept (and stop) negative feedback from unhappy customers. 5. Correct Your Mistake and Promote Changes Once you fix product bugs or resolve a particular issue that a customer had with your company, you shouldn’t be silent about it. Revisit all the negative reviews, describe what you’ve done to fix things, and encourage your unhappy customers to see it for themselves. To illustrate the point, let’s talk about another automotive behemoth who was involved in a scandal. In 2010, Toyota had to recall 8.8 million vehicles due to safety defects. Although the company’s initial response was slow and clunky, it managed to justify its previously impeccable reputation in terms of customer service and product quality by fixing the issue and offering extended warranties. Apart from that, the company’s marketing strategy revolved around its attempts to fix issues and convinced its customers that they didn’t have a reason to worry about safety. As you can see, negative customer experiences and bad online reviews don’t have to turn into a kiss of death. If you leverage the right problem-solving strategies and an honest and responsible approach, you can even benefit from the wrath of an occasional unhappy customer.  

Implementing Ethics in Daily Life
Sep 24, 2019 3 min read

Ethics!! if you are asked what is Ethics? What would be your answer -? So easy .... Being Ethical is Ethics... It's so easy, I mean really it is so easy!! If YES then why nowadays we all need a serious lesson for being ethical. So here we go:- Ethic is actually meant for all human beings, whatever profession you are in, Being Ethical sometimes comes at a personal cost. In layman language, Ethics says - We should not Exploit other people, no lies, no cheating, and stealing... but most of the people are having more interest in doing this, that is matter to worry!! There are a few other things you should know about ethics. It's not all theory and complex dilemmas To be honest, there is no balance at all now a day being it, employee or employer, all are focusing on personal benefit....We all see signals and if Traffic police will be there, we will wait till the signal changes otherwise we will simply break it... Fake profiles on Linked In and other social media are examples of how ethical we all are!! We always go for an option which gives us some benefits. WIN-WIN situation is just in a book. I mean, we never pay attention to beggars but we will surely throw a grand party on Birthday, we never get concerned for someone's problem whether it is because of us or not, we will surely break the signals if traffic police are not there,   That was something being an individual in society. Let's see some examples of professionals, Money is honey!!!! YES... we all are running for money, in this race, we hardly carry ethics, as being a part of any organization. The majority of us will incline towards the thing which gives us monetary benefit, being its right or wrong... for short term benefit, one will never think if it may cost huge to someone else. we will never fail to take credit for something which we have not done, its Appraisal time of course !!!! "I have 5 offers in hand and I will choose the best one " what about the other 4 who are hoping for you. Another example is - I know many companies who don't pay salaries to their employees just because he is not able to bring a business!! What about those efforts he put in, the time he spent in the company! There are many examples which we can share because we might confront a lot of such scenario around us.   Look, and share your experience as well - Let's try to create a vibe where people do care for each other!  

Backup Scheduling in SQL Server Express
Sep 20, 2019 2 min read

Have you ever attempted to set up an automated backup of your SQL Server Express Edition and found that there’s no SQL Server Agent where you can schedule the job which will took a backup of your database. Alas, the world does not end there and you don't need to pay extra bucks just to have the back up via an SQL Agent which is available only to Standard and Enterprise editions. There are many options to automate the backup job which runs on a specific time and does not require manual intervention. Here, we will learn how to do it via SQL Command using batch file and Windows in-build Task Scheduler. Hope, you may find this useful. Create a BAT(batch) file to execute the command to take a backup of Database and save it. echo off :: -------------------------------------------------- :: clear console cls :: -------------------------------------------------- :: Define variables set SERVERNAME=YOUR_SERVER_NAME set DATABASENAME=DATABASE_NAME set MyTime=%TIME: =0% set MyDate=%DATE:~-4%.%DATE:~7,2%.%DATE:~4,2%.%MyTime:~0,2%.%MyTime:~3,2%.%MyTime:~6,2% set FileName=%DATABASENAME%_%MyDate%.bak set BAK_PATH=DIRECTORY_PATH set DEST_FILE=%BAK_PATH%%FileName% :: -------------------------------------------------- :: BACKUP Database sqlcmd -E -S %SERVERNAME% -d master -Q "BACKUP DATABASE [%DATABASENAME%] TO DISK = N'%DEST_FILE%' WITH INIT , NOUNLOAD , NAME = N'%DATABASENAME% backup', NOSKIP , STATS = 10, NOFORMAT" :: -------------------------------------------------- :: Optional Part :: -------------------------------------------------- :: Zip file 7z a -tzip "%DEST_FILE%.zip" "%DEST_FILE%" :: -------------------------------------------------- :: Delete unziped file DEL "%DEST_FILE%"   “SERVERNAME” is the name of SQL Server physical machine. “DATABASENAME” is the database which will be backup. “FileName” sets as a database name and append date which has .bak extension  “BAK_PATH” is the path in which a database backup file will be saved. “DEST_FILE” is use backup path and file name. After defining all the variables database backup will be generated and save as zip file in “DEST_FILE” path and at the end, the unzipped file will be deleted from “DEST_FILE” Now, it's time to schedule this created batch file in #1 Start Menu -> Task Scheduler -> Run as administrator Click on Create Task... from the right bar and configure it with Triggers and Actions  

Unlock Audience Engagement Techniques
Sep 17, 2019 3 min read

Keep your readers interested in your post with these guidelines; Today, information is at our fingertips and we can access it from anywhere on any device. Just a few taps pull up millions of websites all competing for our attention. For any writers or publisher, engaging with your audience has never been more important or more challenging. To help lay the foundation to a winning engagement strategy, here I am with few tips to hold on your audience to you!   One Research shows that 29% of smartphone users will immediately switch to another site or app if it doesn’t satisfy their needs. To help keep your audience engaged do cross check your content with following points   1. Make your post, material more interesting with eye catchy colors and pictures: This is an absolutely psychological effect; we first attract towards the thing which is more catchy or grabbing our attention. Make sure you have used enough better picture relevant to your post and used colour therapy as well to grab more viewers   2. Your Title should be gist of your whole story OR it should give an idea what your post is about; By reading your title viewers should have idea what he is going through by reading this post. It has to be relevant at the same time with the post. After all your title will decide if viewer would love to go through your post or not.   3. Develop content that resonates with your audience When you are writing or posting anything you will have better idea who are your target audience, it has to be as per the interest level of the audience.   4. Make your content easy to consume Always try to give explanation with real examples or with reference to current affairs, this way you can make your content easier to understand for the audience. Try to make direct connection with your audience by sharing or referring their views and reaction over your previous content, it will make them feel that they are getting recognized as well.   5. Be regular in writing or posting We all know market is full of competition, any one is easily replaceable so as you. Be regular in posting your content otherwise it can be question to you activeness. You would not be a part of play anymore!   6. Always appreciate reviews and comments of your audience Do not get in to the war with any of your commentator, however at the same time you should answer them in better language. Never be abusive or restless in conversation!   If you’re interested in more such materials from us then do let us know your views at hello@magnusminds.net

We adopted Eco-friendly Ganesha in 2019 @MagnusMinds
Sep 10, 2019 1 min read

We adopted Eco-friendly Ganesha in 2019 at MagnusMinds

Why Your Business Needs a Website
Sep 04, 2019 2 min read

It’s simple, if you have a business you must need a website to succeed online. If you do not have a website your business doesn’t exist. In this digital era, people are engaged on the internet to find information, product, and services. In simple words to say your website is made for your customers to find you online and get noted by them for your offerings/services. Here mentioned are few benefits of making a website for your business. Online Advertisement A website can be a greater tool for advertising. With the help of the best SEO service provider, your website will be ranked on top search results to increase website traffic and generate more sales and profits. Gaining more customers Print media, Radio Ads, Television Ads can be very expensive channels in the advertisement as compared to Websites. You can choose an affordable SEO agency to improve your website performance to help you gain more customers to your city, state, worldwide. 24x7x365 days Accessible Make sure your website is accessible all the time, hence it is convenient for your customers to visit any time to you. People can find complete information about your products and services in which you deal. Keeping a strong presence online will help you increase customer base, with the help of the website you are noted all over the world. Large Opportunity Through the website, you can build trust, which in turn helps to earn the large no. of opportunities through your website. Large no. of opportunities can tend to large no. of conversion. The above mentioned are not the only benefits of having a website. On the basis of the type of business requisites, it differs from case to case.

Payment Gateway Selection Tips
Aug 09, 2019 2 min read

For any business, it is imperative to choose the best Online Payment Gateway. eCommerce is the fastest growing industry holding immense potential. There’s a multitude of eCommerce Payment Gateway options. So, there’s a struggle to choose the platform meeting specific requirements. Choosing a Payment Gateway Solution is a focal point for an eCommerce website. A payment gateway is a valuable tool for eCommerce websites which may be online, web, or mobile app. All the websites are customer-centric. So, you have to provide a safe, quick, and Secure Payment Gateway. Many pathways for payment and fast settlement becomes vital. It is an integrated solution for POS (point of sale). Let’s discuss the details of choosing a payment gateway for an eCommerce website.   The Work Module Of Payment Gateways Payment Gateway is the third-party service. Understanding the Working of Payment Gateway is vital. It supports automation of transactions for any Business Niche. It also facilitates the authorized transfer after validating credentials. A payment gateway handles information sharing between the Payment Portal and Front-End Processor. Payment Gateway Providers offers easy & fast online transaction between a buyer & seller. Without a Best Online Payment Gateway, it is not possible to pay for any service or product. PayPal, PayU , Citrus are examples of a Payment Gateway Companies. If you are looking to build up such payment gateway then send an inquiry at sales@magnusminds.net